Click here to Skip to main content
15,889,699 members
Home / Discussions / C#
   

C#

 
QuestionHeaderFile vs Class Pin
jashimu20-May-10 4:13
jashimu20-May-10 4:13 
AnswerRe: HeaderFile vs Class Pin
Pete O'Hanlon20-May-10 4:23
mvePete O'Hanlon20-May-10 4:23 
GeneralRe: HeaderFile vs Class Pin
jashimu20-May-10 4:38
jashimu20-May-10 4:38 
GeneralRe: HeaderFile vs Class Pin
PIEBALDconsult20-May-10 6:15
mvePIEBALDconsult20-May-10 6:15 
AnswerRe: HeaderFile vs Class Pin
Luc Pattyn20-May-10 4:55
sitebuilderLuc Pattyn20-May-10 4:55 
GeneralRe: HeaderFile vs Class Pin
jashimu20-May-10 5:41
jashimu20-May-10 5:41 
GeneralRe: HeaderFile vs Class Pin
Luc Pattyn20-May-10 5:54
sitebuilderLuc Pattyn20-May-10 5:54 
QuestionAccessing network share with username & password from c# Pin
Suunil20-May-10 2:56
Suunil20-May-10 2:56 
Hello All .. I am using net use for accessing network share from my c# code. Couple of times it failed for no reason (return code 2) & when I ran the same net use command from command prompt it worked fine & after that I was again able to use the c# code. Looked like something was stuck. I am actually deleting the network share & before creating it as its an issue if I try to re-create.
Is there a issue with this or a better way of accessing network share?

Below is code snippet
----------------

string command = string.Empty;
            System.Diagnostics.ProcessStartInfo procStartInfo;
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            command = "net use " + sharedLocation + " //Delete";
            procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
            procStartInfo.RedirectStandardOutput = true;
            procStartInfo.UseShellExecute = false;

            // Do not create the black window.
            procStartInfo.CreateNoWindow = true;

            // Now we create a process, assign its ProcessStartInfo and start it
            proc = new System.Diagnostics.Process();
            proc.StartInfo = procStartInfo;
            proc.Start();
            proc.WaitForExit();

            command = "net use " + sharedLocation + " " + password + @" /user:" + user;
            procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
            procStartInfo.RedirectStandardOutput = true;
            procStartInfo.UseShellExecute = false;

            // Do not create the black window.
            procStartInfo.CreateNoWindow = true;

            // Now we create a process, assign its ProcessStartInfo and start it
            proc = new System.Diagnostics.Process();
            proc.StartInfo = procStartInfo;
            proc.Start();
            proc.WaitForExit();

----------------

Thanks for your help!!
QuestionUploading with WebClient Pin
Matt Cavanagh20-May-10 2:13
Matt Cavanagh20-May-10 2:13 
Questiondatagrid view autocomplete Pin
NarendraSinghJTV20-May-10 2:00
NarendraSinghJTV20-May-10 2:00 
QuestionC# Forms: Capture scroll event in a usercontrol with only static checkboxes. Pin
willempipi20-May-10 0:28
willempipi20-May-10 0:28 
AnswerRe: C# Forms: Capture scroll event in a usercontrol with only static checkboxes. Pin
Henry Minute20-May-10 1:55
Henry Minute20-May-10 1:55 
GeneralRe: C# Forms: Capture scroll event in a usercontrol with only static checkboxes. Pin
willempipi20-May-10 2:04
willempipi20-May-10 2:04 
GeneralRe: C# Forms: Capture scroll event in a usercontrol with only static checkboxes. Pin
Henry Minute20-May-10 2:07
Henry Minute20-May-10 2:07 
GeneralRe: C# Forms: Capture scroll event in a usercontrol with only static checkboxes. Pin
willempipi20-May-10 2:18
willempipi20-May-10 2:18 
GeneralRe: C# Forms: Capture scroll event in a usercontrol with only static checkboxes. Pin
Luc Pattyn20-May-10 2:47
sitebuilderLuc Pattyn20-May-10 2:47 
GeneralRe: C# Forms: Capture scroll event in a usercontrol with only static checkboxes. Pin
willempipi20-May-10 3:25
willempipi20-May-10 3:25 
GeneralRe: C# Forms: Capture scroll event in a usercontrol with only static checkboxes. Pin
Luc Pattyn20-May-10 3:30
sitebuilderLuc Pattyn20-May-10 3:30 
QuestionVSS and Visual studio Pin
Zeyad Jalil20-May-10 0:25
professionalZeyad Jalil20-May-10 0:25 
AnswerYou have a habit of asking none C# questions in this forum. Would you please not do that? Pin
Pete O'Hanlon20-May-10 0:42
mvePete O'Hanlon20-May-10 0:42 
QuestionHow to create Contact form with C# in ASP.NET Pin
BasPoldervaart19-May-10 23:15
BasPoldervaart19-May-10 23:15 
AnswerRe: How to create Contact form with C# in ASP.NET Pin
Arun Jacob19-May-10 23:31
Arun Jacob19-May-10 23:31 
Questiondecimal question Pin
Jassim Rahma19-May-10 23:14
Jassim Rahma19-May-10 23:14 
AnswerRe: decimal question Pin
OriginalGriff20-May-10 1:17
mveOriginalGriff20-May-10 1:17 
AnswerRe: decimal question Pin
Heinzzy20-May-10 1:59
Heinzzy20-May-10 1:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.