How to provide an auto-escaped input string to a console application?
I mean inside my code, I can do
public static void main(string[] args) { string myURL; myFolder = @"C:\temp\january\";
How can I provide myFolder values if I don't have to manually escape from it via the command line?
If possible, I want to avoid calling this application as follows:
C:\test> myapplication.exe "C:\\temp\\january\\"
EDIT: instead, I would rather call the application like this if possible
C:\test> myapplication.exe @"C:\temp\january\"
Thanks.
EDIT:
This is true for a console application that invokes SharePoint web services. I tried
string SourceFileFullPath, SourceFileName, DestinationFolder, DestinationFullPath; //This part didn't work. Got Microsoft.SharePoint.SoapServer.SoapServerException //SourceFileFullPath = args[0]; // C:\temp\xyz.pdf //SourceFileName = args[1]; // xyz.pdf //DestinationFolder = args[2]; // "http://myserver/ClientX/Performance" Reports //This worked. SourceFileFullPath = @"C:\temp\TestDoc2.txt"; SourceFileName = @"TestDoc2.txt"; DestinationFolder = @"http://myserver/ClientX/Performance Reports"; DestinationFullPath = string.Format("{0}/{1}", DestinationFolder, SourceFileName);
source share