开发者

automating regular windows functions using c sharp

开发者 https://www.devze.com 2023-03-01 01:25 出处:网络
I am trying to build a windows application that will automate a regular routine steps that I have to do for taking a backup.

I am trying to build a windows application that will automate a regular routine steps that I have to do for taking a backup.

The flow goes like this...

1.open a folder

2.run an exe there

3.open jumpbox server at which point we have to enter a username and password

4.create a folder

5.then open a network folder using the ip such as //ip.ip.ip.ip/folder (i do this from run)

6.copy a file from 开发者_运维技巧this folder to the created folder and rename it

and some other stuff like this.

I handle some of the stuff like open a folder, creating a folder and stuff like that but how to connect to a network folder and give the username and password to it when its asking from within the application.


All these things that can be controlled with a .Net application.

You can use System.Diagnotics.Process to launch other executables in a process.

Both System.IO.Directory and System.IO.DirectoryInfo can be used to do all sorts of folder manipulation.

As for connecting to a network drive which, I think is the actual question, you'll have to excuse my ignorance on jumpboxes. If a user on your domain has access you will need to impersonate that user as suggested here, or if it is a seperate domain, as I suspect is the case, you can use the API as suggested here.


I see you run external commands, so you could use "NET USE...".
Run NET HELP USE to see syntax...

0

精彩评论

暂无评论...
验证码 换一张
取 消