Reputation: 9
I have the string below that works fine:
/* Upload a File */
ftpClient.upload(GetPublicIpAddress() + ".stats." + userName + ".dat", @"C:\Users\variable\AppData\Roaming\miner\stants.dat");
I am trying to change it so where it says
users\variable\AppData
it substitutes the user's name for 'variable'. I have this below
variable = userName
/* Upload a File */
ftpClient.upload(GetPublicIpAddress() + ".stats." + userName + ".dat", @"C:\Users\"+ userName +"\AppData\Roaming\miner\stants.dat");
I get the following error
Error 3 Unrecognized escape sequence C:\ConsoleApplication1\Program.cs
Upvotes: 0
Views: 57
Reputation: 7147
You are missing a second @ symbol.
ftpClient.upload(GetPublicIpAddress() + ".stats." + userName + ".dat", @"C:\Users\"+ userName +@"\AppData\Roaming\miner\stants.dat");
Once you split the string into 2, you need to prefix both strings with @.
Upvotes: 6