如何在VB指定的路径中运行exe文件。净或c#。净(windows应用程序)

时间:2021-06-19 09:28:25

First I am running the below Command "mysqldump.exe --user=root --password=root accounts>accounts.sql" in the path C:>, to take backup, but it show error message "mysqldump is not a recognized command".

首先运行下面的命令“mysqldump”。exe——用户= root密码= root账户>账户。sql“在路径C:>中进行备份,但它显示错误消息“mysqldump不是一个可识别的命令”。

Then i changed the path in command prompt using the cd command to the location "C:\Program Files\MySQL\MySQL Server 5.0\bin>"

然后我使用cd命令在命令提示符中将路径更改为“C:\程序文件\MySQL\服务器5.0\bin>”

Now i am running the below command.

现在我运行下面的命令。

C:\Program Files\MySQL\MySQL Server 5.0\bin> mysqldump.exe --user=root --password=root accounts>accounts.sql

5.0 \ bin >,mysqldump C:\Program Files\MySQL\MySQL服务器。exe——用户= root密码= > accounts.sql根帐户

It is successfully working, but how can i achieve this work from VB.NET or C#.NET.

它成功地工作了,但是我怎样才能从VB中实现这个工作呢?净或c# . NET。

2 个解决方案

#1


3  

Not quite sure what you are asking, but the following, runs the mysqldumb.exe with the parameters you specified. (C#)

不太确定要问什么,但是下面运行mysqldumb。用您指定的参数执行。(c#)

Process.Start(@"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump.exe", "--user=root --password=root accounts>accounts.sql")

#2


0  

You mean changing the current path? Here's the C# code to do it ...

你是说改变当前路径?这是c#代码…

Directory.SetCurrentDirectory(@"C:\Program Files\MySQL\MySQL Server 5.0\bin");

#1


3  

Not quite sure what you are asking, but the following, runs the mysqldumb.exe with the parameters you specified. (C#)

不太确定要问什么,但是下面运行mysqldumb。用您指定的参数执行。(c#)

Process.Start(@"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump.exe", "--user=root --password=root accounts>accounts.sql")

#2


0  

You mean changing the current path? Here's the C# code to do it ...

你是说改变当前路径?这是c#代码…

Directory.SetCurrentDirectory(@"C:\Program Files\MySQL\MySQL Server 5.0\bin");