I am creating a function that creates a user-inputed directory and a string to create .txt with a string Uses for Here is my code:
Private Zero MakeTheTxt (string theTest) {string fileName = @ textbox directory. Text; Try {File.WriteAllLines (Filename, The Test); } Hold (DirectoryNotFoundException e) {MessageBox.Show ("Please enter a valid directory."); }}
WriteAllLines ()
function says that the arguments are not valid. I looked at the parameters of this function and one of the overloaded definitions public static zero WriteAllText (string path, string content);
. I give the function the right logic type but it is not working. Any suggestions?
all written lines
have no overload, which are two string
s
You probably want to use (string path, string content) overload . >
file. Write All Text (Filename, The Test);
Comments
Post a Comment