奇怪,msdn上说有啊。Platforms:Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition参考:
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.restart(v=vs.80).aspx
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.restart(v=vs.80).aspx
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.Data.SqlClient;
using System.Xml;
刚才我看了下1楼的,确实有Restart这个函数的啊
如果你那里没有Restart的话,可以触发个什么事件,写在Program中重新实例化
Shuts down the application and starts a new instance immediately.Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)没有缺少,就在System.Windows.Forms中,但跟你调用Application.Restart()的域/位置相关,直接在一个类下而不是方法中肯定没有Restart的
private void btnSave_Click(object sender, EventArgs e)
{
Application.Restart();
}
提示错误 “System.Windows.Forms.Application”并不包含“Restart”的定义
写在program中看看如何?