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:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...