Code for Reading and writing from a file in c#?
Answer / sabina
StreamWriter and StreamReader can be used to read and write
unicode chars to a file.
TextWriter adn TextReader are abstract base class from
which SW and SR inherits.
Stream is an abstract base class supports reading and
writing bytes into a file(arrays -> file) (file -> arrays)
FileStream exposes the stream ard the file
BinaryStream is used to write and read primitive
datatypes/encoded strings to files.
to encode string to bytes
byte[] b = new UTF8Encoding(true).GetBytes(string);
to decode string from bytes
String str = new UTF8Encodeing(true).GetString(b);
Is This Answer Correct ? | 0 Yes | 0 No |
Write a program which has a function and that function should take 2 or 3 or any number of strings and it should return the largest common prefix of all those strings. If there is no common prefix it should return an empty string. for eg:- INPUT OUTPUT glo {glory,glorious,glod} gl {glad,glow} {calendar,phone} empty string
How to Create a Treeview Menu in ASP.NET with C#?
How to export 2 datatables of a single dataset to 2 different worksheets of a single MSExcel file ?
Write a program to input an integer and - display the reverse - display the sum of each digit - should include logic that considers the input number as any number of digits long
program for straight line(y=mx+c)
program to check if a number is "perfect number".
Write a program to convert postfix expression to infix expression.
How to Create Files by Using the FileInfo Class?
Write a program to count 3Letter, 4Letter and 5Letter words from a file and print the number of 3Letter, 4Letter and 5Letter words. Delimiter is space, tab, hifen. Also we should not consider the line in the file after we encounter # in that line.
c# coding for a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors not using the Big-integer and Exponential Function's.
How to find No of classes,Packages,No of Methods per Classes and Depth of Inheritance for selecting source code in windows form application using c# .net? (Source code is input Program. It may be Java or .net) Please help me..) Thanks..)
Create a class called Accounts which has data members like ACCOUNT no, Customer name, Account type, Transaction type (d/w), amount, balance D->Deposit W->Withdrawal If transaction type is deposit call the credit(int amount) and update balance in this method. If transaction type is withdraw call debit(int amt) and update balance. Pass the other information like Account no,name,Account Type through constructor. Call the show data method to display the values.