login - How to open a Network Share in C# -
im trying write program in c# opens network share on local network. problem run getting past user login of network share.
normally in windows can \192.168.101.10 enter in username "nick" password "nick"
so code follows
void folderpathlist_mousedoubleclick(object sender, mousebuttoneventargs e) { //throw new notimplementedexception(); computermodel selectedcm = (computermodel)folderpathlist.selecteditem; string uname = "nick"; system.security.securestring password= new system.security.securestring("nick"); if (capturedevices.ischecked != true) system.diagnostics.process.start("explorer.exe", uname, password, "\\\\192.168.101."+selectedcm.ip+"\\ppt"); if (capturedevices.ischecked != false) system.diagnostics.process.start("explorer.exe", uname, password, "\\\\192.168.101."+selectedcm.ip+"\\c$\\users\\nick\\desktop"); } it works absolutely fine if have just
void folderpathlist_mousedoubleclick(object sender, mousebuttoneventargs e) { //throw new notimplementedexception(); computermodel selectedcm = (computermodel)folderpathlist.selecteditem; if (capturedevices.ischecked != true) system.diagnostics.process.start("explorer.exe", "\\\\192.168.101."+selectedcm.ip+"\\ppt"); if (capturedevices.ischecked != false) system.diagnostics.process.start("explorer.exe", "\\\\192.168.101."+selectedcm.ip+"\\c$\\users\\nick\\desktop"); } however first have hit each computer in local network first, enter in username , password once, , computer remembers it. whenever shut down , start again have manually each time. doing wrong?
Comments
Post a Comment