呵呵~~~ ,我只会用VC做,转行学VC吧~~
解决方案 »
- 高分求助 达人帮忙 ListView1_DblClick
- VB6+SQL2000应用程序打包问题
- 关于picturebox的宽度和像素问题
- VBA: 请问在 Word 中如何替换搜索到的内容中一部分内容的样式?
- 下面代码在ACCESS2000版本中正常,在SQL版本中老是报错,请高手指点
- 从数据库中读图片的问题.
- 请问各位,用什么方法可以发现一个钱数能否被平均分配?多谢了
- CallByName函数的具体用法问题?
- 请问如何将DBGRID控件的表格打印出来,详细问题请看看文章。急!急!
- 如何获取CommonDialog.showopen中的盘符和路径及文件名
- 求大虾指点!
- 如果使vb的应用程序在按下ctrl+alt+del时不显示出来?(无内容)
LPCTSTR lpMachineName, // pointer to machine name string
LPCTSTR lpDatabaseName, // pointer to database name string
DWORD dwDesiredAccess // type of access
);
SC_HANDLE CreateService(
SC_HANDLE hSCManager, // handle to service control manager
// database
LPCTSTR lpServiceName, // pointer to name of service to start
LPCTSTR lpDisplayName, // pointer to display name
DWORD dwDesiredAccess, // type of access to service
DWORD dwServiceType, // type of service
DWORD dwStartType, // when to start service
DWORD dwErrorControl, // severity if service fails to start
LPCTSTR lpBinaryPathName, // pointer to name of binary file
LPCTSTR lpLoadOrderGroup, // pointer to name of load ordering
// group
LPDWORD lpdwTagId, // pointer to variable to get tag identifier
LPCTSTR lpDependencies, // pointer to array of dependency names
LPCTSTR lpServiceStartName,
// pointer to account name of service
LPCTSTR lpPassword // pointer to password for service account
);
SC_HANDLE OpenService(
SC_HANDLE hSCManager, // handle to service control manager
// database
LPCTSTR lpServiceName, // pointer to name of service to start
DWORD dwDesiredAccess // type of access to service
); BOOL DeleteService(
SC_HANDLE hService // handle to service
);
BOOL StartServiceCtrlDispatcher(
LPSERVICE_TABLE_ENTRY lpServiceStartTable // address of service
// table
);
BOOL SetServiceStatus(
SERVICE_STATUS_HANDLE hServiceStatus~,
// service status handle
LPSERVICE_STATUS lpServiceStatus // address of status structure
);
发邮件给我,OK?
"[email protected]"
thanks !
Email:[email protected]
我这里有你需要的真正的VB/NT服务程序,及编写需要的利器,如需:EMAIL:[email protected],用了以后,不要不给分!!!
there is a famouse wizard for
create a nt service project.
good lucky.
jansen zhu.
srvinstw.exe -- install a application as a service programsrvany.exe -- encapsulate application to a service programYou'd better don't use VB write service, MS don't support that!These utility could be found from NT resource kit.
Sub Main()
Load Form1
Dim strDisplayName As StringOn Error GoTo Err_Load strDisplayName = Form1.NTService1.DisplayName
If Command = "-install" Then
' Enable interaction with desktop.
Form1.NTService1.Interactive = True
If Form1.NTService1.Install Then
MsgBox strDisplayName & " installed successfully"
Else
MsgBox strDisplayName & " failed to install"
End If
End
ElseIf Command = "-uninstall" Then
If Form1.NTService1.Uninstall Then
MsgBox strDisplayName & " uninstalled successfully"
Else
MsgBox strDisplayName & " failed to uninstall"
End If
End
ElseIf Command = "-debug" Then
Form1.NTService1.Debug = True
ElseIf Command <> "" Then
MsgBox "Invalid command option"
End
End If
' Connect service to Windows NT services controller.
Form1.NTService1.StartService
Err_Load:
' Error starting service
End SubPrivate Sub NTService1_Start(Success As Boolean)
On Error GoTo Err_Start ' TODO: Begin processing Success = True ' Report successErr_Start:
Call NTService1.LogEvent(svcMessageError, svcEventError, "[" & _
Err.Number & "] " & Err.Description)End Sub
Private Sub NTService1_Start(Success As Boolean)
On Error GoTo Err_Start ' TODO: Begin processing Success = True ' Report successErr_Start:
Call NTService1.LogEvent(svcMessageError, svcEventError, "[" & _
Err.Number & "] " & Err.Description)End Sub
希望以上的例子对大家有用:
注意运行时:***.exe -install :装入服务程序(运行后打开你的控制面板,查看服务,发现了什么??!!!)
***.exe -install :卸载服务程序
Http://msdn.microsoft.com/library/techart/msdn_ntsrvocx.htm