Guys i am trying to use the following lines of code, but when i check out the file that is being saved, all i see is the exact same text. but not the converted bytes, What am i doing wrong?
String text = "Line 1" + Environment.NewLine;
text += "Line 2" + Environment.NewLine;
text += "Line 3" + Environment.NewLine;
text += "Line 4" + Environment.NewLine;
Byte[] b = Encoding.ASCII.GetBytes(text);
File.WriteAllBytes(path, b);
Loading
VulpesPosted Aug 2, 2012, 10:36 AM
For example, try running this program and then opening the resulting text file with notepad:
kiran murthyPosted Aug 3, 2012, 5:43 AM
VulpesPosted Aug 2, 2012, 12:36 PM
kiran murthyPosted Aug 2, 2012, 11:47 AM
VulpesPosted Aug 2, 2012, 11:09 AM
You should see output like this:
54 68 65 20 71 75 69 63 6b 20 62 72 6f 77 6e 20
66 6f 78 20 6a 75 6d 70 73 20 6f 76 65 72 20 74
68 65 20 6c 61 7a 79 20 64 6f 67
kiran murthyPosted Aug 2, 2012, 10:58 AM
kiran murthyPosted Aug 2, 2012, 9:41 AM
VulpesPosted Aug 2, 2012, 8:41 AM