如何隐藏掉 控制台应用程序的运行窗口,让程序在后台运行 如题,有什么简单的方法?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在你的console程序中写 [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)] private static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow); [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); Console.Title = Guid.NewGuid().ToString("n"); var w = FindWindow("ConsoleWindowClass", Console.Title); if (w != IntPtr.Zero) ShowWindow(w, 0); winform离线地图解决方式? 关于report viewer的使用(经验总结和代码实例) C#写的下载工具,应该如何获取网络上文件的大小? 怎么判断两个文件是不是一样 c#中怎样将字符串转换为日期时间格式? 大家帮我看看这个问题!! 求如何读写XML文件! RichTextBox控件输入的文本怎么才能不与前面格式一样啊? 页面(数据库)的内容如何打印? C#中有没有CList? asp.net连接数据库sql登录界面代码 c#去除重复项
[DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)]
private static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
Console.Title = Guid.NewGuid().ToString("n");
var w = FindWindow("ConsoleWindowClass", Console.Title);
if (w != IntPtr.Zero)
ShowWindow(w, 0);