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 |
program to reverse the order of digits in a given number of any length.
How to Create Files by Using the FileInfo Class?
How to Create a Treeview Menu in ASP.NET with C#?
Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik
Write a program. there are 1..n numbers placed in an array in random fashion with one integer missing. find the missing number.
How to add a value from textBox over an existing certain column in SQL Server
How to pass multiple rows from one gridview to another gridview after clicking the checkbox.
how do i copy textbox contents of 1 form to another form
Write a program to count the number of characters, number of words, number of line in file.
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 sharp" code for factorial using static variables
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