Windows服务创建及安装

http://blog.sina.com.cn/s/blog_6e110f4801018x6v.html

http://www.cnblogs.com/tuyile006/archive/2006/11/27/573654.html

installutil安装服务式帐户名无效或不存在,或者密码对于指定的帐户 名无效。

http://blog.csdn.net/dengmm/article/details/7366577

http://hi.baidu.com/88_0922/item/9127cae61daac2adc10d75cc

使用程序代码安装/卸载.net服务(不使用InstallUtil.exe)

http://blog.csdn.net/haukwong/article/details/7022961



调试服务程序

①用VS2010-〉工具-〉加载进程ー>选择服务

②用反射调用

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try

           '服务程序

            Dim test As GetButtonState = New GetButtonState()

            Dim type As Type = test.GetType()

             '获取方法名
            Dim mi1 As MethodInfo = type.GetMethod("OnStart", BindingFlags.Instance Or BindingFlags.NonPublic)

            Dim args As Object = New String() {"arg1"}

            `'调用
            mi1.Invoke(test, New Object() {args})

        Catch ex As Exception

        End Try
    End Sub




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值