当前位置: 首页 > news >正文

做问卷调查的网站有哪些网站建设学习

做问卷调查的网站有哪些,网站建设学习,百度竞价品牌广告,成都网页设计培训学校排名由于经常要使用CMD的一些命令#xff0c;比如查看IP#xff0c;Ping一个网址之类的。于是就写了一个调用CMD.exe的小工具。 主要就是实现这样一个事情#xff1a;调用CMD.exe然后传给它我想要执行的命令#xff0c;最后获取结果。 界面#xff1a; 代码#xff1a; 主要执… 由于经常要使用CMD的一些命令比如查看IPPing一个网址之类的。于是就写了一个调用CMD.exe的小工具。 主要就是实现这样一个事情调用CMD.exe然后传给它我想要执行的命令最后获取结果。 界面 代码 主要执行代码using System.Diagnostics; using System.IO;namespace Client {class ExcuteCMD{static Process p new Process();public static string Excute(string cmd){//创建Process对象p.StartInfo.FileName cmd.exe; //要调用的程序 p.StartInfo.UseShellExecute false; //关闭Shell的使用 p.StartInfo.RedirectStandardInput true; //重定向标准输入 p.StartInfo.RedirectStandardOutput true; //重定向标准输出 p.StartInfo.RedirectStandardError true; //重定向错误输出 p.StartInfo.CreateNoWindow true; //设置不显示窗口 p.Start(); //启动进程 p.StandardInput.WriteLine(cmd); //要执行的命令 p.StandardInput.WriteLine(exit);#region 吸收版权信息p.StandardOutput.ReadLine();p.StandardOutput.ReadLine();p.StandardOutput.ReadLine();p.StandardOutput.ReadLine();p.StandardOutput.ReadLine();#endregionstring strRst p.StandardOutput.ReadToEnd(); //从输出流获取命令执行结果 // logOut(strRst,cmd); // 记录执行到日志文件return strRst;}public static void closeCMD(){p.Close();}private static void logOut(string log,string cmd){FileStream fs new FileStream(log.txt, FileMode.OpenOrCreate, FileAccess.Write);StreamWriter sw new StreamWriter(fs);sw.Flush();sw.BaseStream.Seek(0, SeekOrigin.End);sw.WriteLine(cmd log);sw.WriteLine();sw.Flush();sw.Close();fs.Close(); }} } WPF界面代码using System.Windows; using System.Windows.Input;namespace Client {/// summary/// MainWindow.xaml 的交互逻辑/// /summarypublic partial class MainWindow : Window{public MainWindow(){InitializeComponent();tbCmd.Focus();}private void btnSubmit_Click(object sender, RoutedEventArgs e){lblResult.Content ExcuteCMD.Excute(tbCmd.Text); }private void btnClose_Click(object sender, RoutedEventArgs e){ExcuteCMD.closeCMD();this.Close();}private void btnPingQQ_Click(object sender, RoutedEventArgs e){lblResult.Content ExcuteCMD.Excute(Ping www.qq.com);}private void btnIPConfig_Click(object sender, RoutedEventArgs e){lblResult.Content ExcuteCMD.Excute(ipconfig);}private void tbCmd_KeyDown(object sender, KeyEventArgs e){if (e.Key Key.Enter){btnSubmit_Click(sender, e);}}} }WPF界面代码Window x:ClassClient.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlTitleCMD命令执行工具 Height300 Width478 MinWidth400 MinHeight300 Icon/Client;component/Images/21.icoGridGrid.RowDefinitionsRowDefinition Height210* /RowDefinition Height28* /RowDefinition Height23* //Grid.RowDefinitionsButton Content执行 Height23 Margin0,0,66,5 NamebtnSubmit VerticalAlignmentBottom TabIndex2 ClickbtnSubmit_Click HorizontalAlignmentRight Width60 Grid.Row1 /TextBox Height23 NametbCmd VerticalAlignmentBottom Margin0,0,132,5 TabIndex1 Grid.Row1 KeyDowntbCmd_KeyDown /Button Content结束 Height23 HorizontalAlignmentRight Margin0,0,0,5 NamebtnClose VerticalAlignmentBottom Width60 ClickbtnClose_Click Grid.Row1 /ScrollViewer HorizontalAlignmentStretch NamescrollViewer1 VerticalAlignmentStretchLabel HeightAuto NamelblResult HorizontalAlignmentStretch VerticalAlignmentStretch //ScrollViewerButton ContentPingQQ Height23 HorizontalAlignmentLeft NamebtnPingQQ VerticalAlignmentTop Width56 ClickbtnPingQQ_Click Grid.Row2 /Button ContentIPConfig Height23 HorizontalAlignmentLeft Margin62,0,0,0 NamebtnIPConfig VerticalAlignmentTop Width56 ClickbtnIPConfig_Click Grid.Row2 //Grid /Window转载于:https://www.cnblogs.com/sitemanager/archive/2012/03/05/2380551.html
http://www.zqtcl.cn/news/862024/

相关文章:

  • 网站空格键代码台州椒江网站建设公司
  • node 网站开发 视频教程汉阳网站推广
  • 广西新农村建设工作专题网站怎样创建公司网站
  • 中国十大招商平台谷歌优化软件
  • 做任务领黄钻的网站中国采购网招标公告
  • 网站建设三层架构实训报告德阳市网站建设
  • 有免费建网站opencms wordpress
  • 行业网站做的好的wordpress要有数据库
  • 重庆智能网站建设哪里好怎么在微信做企业网站
  • 甘肃建设局网站丰都网站建设公司
  • 四川建设设计公司网站网站建设好的图片
  • 建设旅游网站的总结做网站链接怎么做
  • 深圳网站建设建设wordpress cms 布局
  • 企业网站的建立必要性公司建网站哪家
  • 自己做的旅游网站 介绍免费的网站推广在线推广
  • 阿里巴巴 网站设计龙华建设网站公司
  • 番禺网站优化手机商城是什么意思
  • 如何做网站关键词wordpress安装卡死
  • word模板免费下载网站山东定制网站建设公司
  • 郑州网站推广排名公司win7上怎样卸载wordpress
  • 科技网站有哪些wordpress代码编辑器件
  • 做英文企业网站多钱钱wordpress调用外链图片
  • 自学网站查分数西双版纳傣族自治州天气
  • 网站建设一个多少钱wordpress朗读句子插件
  • 网站关键词怎么填写找代理商的渠道有哪些
  • 网站开发销售简历范文新建网站网络空间
  • 舟山外贸建站公司制作公司简介
  • 菜鸟是什么网站威海网站建设费用
  • 网站开发花费如何制作个人网页兼职
  • 网站鼠标特效用户体验最好的网站