How can i write string in file i tried more methods like :
StreamWriter writer = new StreamWriter(System.IO.Path.GetFullPath("backup.cmd"));
writer.WriteLine("File created using StreamWriter class.");
writer.Close();
And :
System.IO.File.WriteAllText(System.IO.Path.GetFullPath("backup.cmd"), BackupCMD);
and when i try to execute StreamWriter
only without anything the same error
but the the same result :
object reference not set to an instance of an object
I think the error in the StreamWriter
initializing.