c#怎么通过代码启动QQ 例如启动记事本是这样的System.Diagnostics.Process.Start("notepad.exe");但是我不知道括号里该写什么?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 notepad.exe是系统程序 你这样写当然可以至于QQ 我觉得应该写完整路径 System.Diagnostics.Process.Start("D:\\PROGRAM FILES\\QQ2009\\Bin\\QQ.exe");我的QQ路径是"D:\PROGRAM FILES\QQ2009\Bin\QQ.exe"你上面弄成完整路径就可以了我测试我成功的 从注册表里读取QQ安装路径,然后:System.Diagnostics.Process.Start(@"安装目录/QQ.exe"); 对 Start("")中的参数将是qq的完整路径即可 我目前机器没有安QQ,但似乎在HKEY_LOCAL_MACHINE\SOFTWARE\QQ键下。在cmd里,regedit就能看注册表。 <input type="button"> 其实我也发过这样的帖子,如何在C#中使用应用程序,例如,mp3,tet,或其他文件!无人解决!有的说不行! System.Diagnostics.Process.Start("D:\\PROGRAM FILES\\QQ2009\\Bin\\QQ.exe");括号里面是写执行文件的路经 using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Threading; using System.Diagnostics; using System.Security.Cryptography; namespace QQ_AutoStart{ /// <summary> /// Form1 的摘要说明。 /// </summary> public class Form1 : System.Windows.Forms.Form { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // } /// <summary> /// 清理所有正在使用的资源。 /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows 窗体设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(292, 266); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); } #endregion /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private void Form1_Load(object sender, System.EventArgs e) { string qqPath = @"E:\Program Files\Tencent\QQ\QQ.exe"; //改为你的qq安装路径 Process.Start(qqPath); this.Close(); } }} 交友网的课程设计 不使用强命名如何将.Net库注册为COM组件? winform中截取某控件图像 重赏之下必有勇夫!!!求如何将picturebox上的图片存进剪贴板??? 高手来帮忙改一段代码 求yyyy/mm/dd正则表达式 各位大虾看看是咋回事啊??怎么运行的时候出错误呢??? 请问:怎么样才能返回多个值??? 关于读取networkstream的问题。 如何高效获取winform中DataGrid中的所选记录(多条记录选择) 求一源码:c#和asp做的简单登陆注册功能 拼接字符串【string.Concat】真的比【连接符】更好?
至于QQ 我觉得应该写完整路径
System.Diagnostics.Process.Start("D:\\PROGRAM FILES\\QQ2009\\Bin\\QQ.exe");我的QQ路径是"D:\PROGRAM FILES\QQ2009\Bin\QQ.exe"
你上面弄成完整路径就可以了
我测试我成功的
System.Diagnostics.Process.Start(@"安装目录/QQ.exe");
<input type="button">
无人解决!有的说不行!
括号里面是写执行文件的路经
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
using System.Security.Cryptography; namespace QQ_AutoStart
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent(); //
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
} /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load); }
#endregion /// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
} private void Form1_Load(object sender, System.EventArgs e)
{
string qqPath = @"E:\Program Files\Tencent\QQ\QQ.exe"; //改为你的qq安装路径 Process.Start(qqPath); this.Close();
} }
}