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 |
Code for Reading and writing from a file in c#?
How to export 2 datatables of a single dataset to 2 different worksheets of a single MSExcel file ?
program for string reverse(eg:- i am boy -> boy am i)
8 Answers Black Pepper, Infosys, Mind Tree,
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.
Code for Working with Files under a Directory?
how do i copy textbox contents of 1 form to another form
. Write a program to print the following outputs using for loops $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
Write a program to convert postfix expression to infix expression.
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 Files by Using the FileInfo Class?
program for straight line(y=mx+c)
how to get the table names via c sharp and column names also?