Microsoft
Software
Hardware
Network
Question : How to format Process.StartInfo.Arguments with spaces in the arguments?
hi,
I am trying to invoke an ftp command from my C# application using a Process.
I have the below code in my program.
I have spaces in the first argument of the Process and it is acting weird and not formatting properly.
scriptfile = "C:\Program files\PR Ent\AddIns\PR Bridge\Upload\UploadScript
.txt";
s.Filename = "File1";
Process P = new Process();
P.EnableRaisingEvents = true;
P.Exited += P_Exited;
P.StartInfo.FileName = filename;
P.StartInfo.Arguments = scriptfile + s.Filename;
P.Start();
Could anybody please help me how to format properly when having spaces?
Thank you.
Answer : How to format Process.StartInfo.Arguments with spaces in the arguments?
try
P.StartInfo.Arguments = scriptfile + s.Filename;
-->
P.StartInfo.Arguments = "\"" + scriptfile +"\" "+ s.Filename;
Random Solutions
RAID problems on Intel SATA RAID controller
Problem getting the Selected value of a CheckBoxList (used in a gridview)
Wordpress widget with visual editor for non-HTML savvy users
How to Transfer All ZIP files from a FTP Directory using Powershell
Microsoft.Exchange.Search.
ExSearch.e
xe 80% resources
ORA: 6533 Subscript out of range
Enumerable or Strongly typed List of Guids
How can I force Graphics.MeasureString to consider the font style?
how can i get Hard Disk Serial number (unique) in C#.net web application ??
Access / how many users connected?