المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : create file - credentials



C# Programming
07-13-2009, 12:00 PM
Hi,
I have written a code which creates a file on the remote machine.
This works because my login details has permission to do this on the remote machine.
How do I modify this code so that the user's login details are used instead of the default?
Is there somewhere to place the login detauils within this code?

string strvbscript = @"\c$\VBscript.vbs";
string strTargetMachine = @"\\" + strServer;
string strTargetFullPath = strTargetMachine + strvbscript;

//Create the scrip file on the remote machine so that it can be executed...
System.IO.File.WriteAllText(strTargetFullPath, strScript);

Thanks