Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void SaveACopyfileToServer(string filePath, string savePath)
- {
- var directory = Path.GetDirectoryName(savePath).Trim();
- var username = "hp";
- var password = "7303";
- var filenameToSave = Path.GetFileName(savePath);
- if (!directory.EndsWith("\\"))
- filenameToSave = "\\" + filenameToSave;
- var command = "NET USE " + directory + " /delete";
- ExecuteCommand(command, 5000);
- command = "NET USE " + directory + " /user:" + username + " " + password;
- ExecuteCommand(command, 5000);
- command = " copy \"" + filePath + "\" \"" + directory + filenameToSave + "\"";
- ExecuteCommand(command, 5000);
- command = "NET USE " + directory + " /delete";
- ExecuteCommand(command, 5000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement