失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > winform项目制作安装包想把mysql数据库一起附加进去 调用cmd执行脚本无效?

winform项目制作安装包想把mysql数据库一起附加进去 调用cmd执行脚本无效?

时间:2019-11-04 22:38:45

相关推荐

winform项目制作安装包想把mysql数据库一起附加进去 调用cmd执行脚本无效?

数据库|mysql教程

mysql 项目发布打包 c# 项目开发 代码纠错

数据库-mysql教程

mysql项目发布打包c#项目开发代码纠错

js图片滚动源码,vscode里面好用的js插件,ubuntu 导航,tomcat启动磁盘拒绝访问,sqlite 存在更新,网页设计插入音乐播放器,阿里云服务器公网ip和内网ip,discuz 跳蚤市场插件下载,前端js框架讲解,爬虫爬深度,php上传文件夹,牧野seo,springboot接口抓包,网站模板更换,网页制作代码题,discuz门户模板制作,phpcms后台模板修改,html页面滑动效果,权限管理系统源码,无法打开dede安装程序lzw

相关mysql视频教学推荐:《mysql教学》

ios糗事百科app源码,ubuntu软件arm,修改tomcat的系统变量,爬虫爬私钥,php同学录网站源码,乐天SEO培训网站联系方式lzw

string dbname = this.Context.Parameters["dbname"];//数据库名称string server = this.Context.Parameters["server"];//服务器名称string uid = this.Context.Parameters["user"];//SQlServer用户名string pwd = this.Context.Parameters["pwd"];//密码string path = this.Context.Parameters["targetdir"];//安装目录String appDirecroty = "C:\\Program Files\\MySQL\\MySQL Server 5.6\\bin\\";StringBuilder sbcommand = new StringBuilder();string directory = path + "database" + "\\" + "121www.sql";sbcommand.AppendFormat("mysql -uroot -p123456 121www < {0}", directory);String command = sbcommand.ToString(); //MessageBox.Show(command);Cmd.StartCmd(appDirecroty, command);

Cmd中是这样写的

水网站源码,源码编译安装ubuntu,爬虫 得物 c,php imei,博客seo代码lzw

public class Cmd{ ////// 执行Cmd命令 ////// 要启动的进程的目录 /// 要执行的命令 public static void StartCmd(String workingDirectory, String command) { Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; //MessageBox.Show(p.StartInfo.WorkingDirectory); p.StartInfo.WorkingDirectory = workingDirectory; //MessageBox.Show(p.StartInfo.WorkingDirectory); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.StartInfo.CreateNoWindow = true; p.Start(); p.StandardInput.WriteLine(command); //MessageBox.Show(command); p.StandardInput.WriteLine("exit"); }

如果觉得《winform项目制作安装包想把mysql数据库一起附加进去 调用cmd执行脚本无效?》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。