Dos Command
-
Hi Experts, Kindly let me know that, How may I use following command using C#? MD C:\ABC123 Regards (Riaz)
-
Hi Experts, Kindly let me know that, How may I use following command using C#? MD C:\ABC123 Regards (Riaz)
Google is your friend: http://msdn.microsoft.com/en-us/library/as2f1fez.aspx[^]
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
Google is your friend: http://msdn.microsoft.com/en-us/library/as2f1fez.aspx[^]
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001Thank you
-
Hi Experts, Kindly let me know that, How may I use following command using C#? MD C:\ABC123 Regards (Riaz)
Well, MD means Make Directory, so you could always use the equivalent .NET Framework commands:
if (!Directory.Exists(myDirectory))
{
Directory.CreateDirectory(myDirectory);
}I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
Hi Experts, Kindly let me know that, How may I use following command using C#? MD C:\ABC123 Regards (Riaz)
Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.StartInfo.CreateNoWindow = true; if (p.Start()) { p.StandardInput.WriteLine("net use " + strFileName + " " + strPwd + " /user:" + strDomain + "\\" + strId); p.StandardInput.WriteLine("exit"); p.WaitForExit(); string ReturnText = p.StandardOutput.ReadToEnd(); if (ReturnText.IndexOf("成功") >= 0) Dts.TaskResult = (int)ScriptResults.Success; else throw new Exception("fail"); } else throw new Exception("fail"); Refrence: http://www.programlive.tk