C# 安装布署 及Windows服务自动启动
设置serviceProcessInstaller1控件的Account属性为“LocalSystem”
设置serviceInstaller1控件的StartType属性为"Automatic"
在服务器上添加安装程序,在private void ProjectInstaller_AfterInstall(object sender, InstallEventArgs e)事件中,添加以下代码:
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string Cmdstring = "sc start myservice"; //CMD命令
p.StandardInput.WriteLine(Cmdstring);
p.StandardInput.WriteLine("exit");
即可在安装服务后立刻启动windows服务
注: 引用using System.Diagnostics;//调用Process
C#安装布署
建立一个新的安装项目ServerSetup(为刚才那个服务建立一个安装项目)
右键-添加-项目输出-主输出-选择Service1-确定
右键-视图-自定义操作-自定义操作上右键-添加自定义操作-打开应用程序文件夹-选择刚才那个主输出-确定
重新生成这个安装项目-右键-安装
查看服务,,则自已的服务("myservice")已自动启动
相关文档:
微软在其.net战略中,对其主推的Web Service做了大肆的宣扬。现在,Web
Service正如火如荼地发展着,相关的各项新技术层出不穷。Web
Service的发展正构筑着互联网时代美好的明天。在本文中,我将向大家介绍Web Service的一些基本知识、如何用C#建立一个Web
Service。通过文章,我们还将对WSDL、UDDI以及未来的Web ......
微软.NET战略的一个比较重要的部分就是webservice,利用webservice我们可以创建真正有效的分布式应用程序。
下面,我们对webservice做一些说明。
假设A是客户端,B是webservice服务端,用户通过http协议向服务器发送soap请求,webservice返回客户端XML格式的数据。
现在我们看一看创建一个webservice的大致过程:
......
protected void Button6_Click(object sender, EventArgs e)
{
this.Label11.Text = HtmlEncode(this.TextBox3.Text);
}
protected static string HtmlEn ......
QZone Editor
.dump{}
//TODO 域名
if (location.hash) {
document.domain=location.hash.substr(1);
}
//parent.qZEditor.callback();
function init(){
//获取编辑器面板ID
var pid = frameElement.panelID;
//获取编辑器面板对象
......
1. 通过 get { return HostApplicationServices.WorkingDatabase; } 得到当前工作数据库,即当前文档被装入CAD环境后得到的所有东西。
2. 属性和方法:
构造函数:
属性:
Attmode 设置
mode
为数据库的
ATTMODE
值,
输入需要的
ATTMODE
系统变量值(必须在范围
0-2
之间
Aunits 输入需要的
AUNITS
......