Friday

C# csharp read from file write into file


public static string ReadFile(string f){
System.IO.StreamReader file = new System.IO.StreamReader(f);
string testxmldata = file.ReadToEnd(); file.Close();
return testxmldata;
}
public void WriteIntoFile(string path,string m) {
if (!File.Exists(path)) {
// Create a file to write to.
using (StreamWriter sw = File.CreateText(path)) {
sw.WriteLine(m);
}
}
else {
// This text is always added, making the file longer over time
// if it is not deleted.
using (StreamWriter sw = File.AppendText(path)) {
sw.WriteLine(m);
}
}
}

more...

No comments:

make ubuntu business casual

to make ubuntu business casual - make it black remove background: gsettings set org.gnome.desktop.background picture-options ...