|
![]() | 作者: ljfgl [ljfgl]
![]() |
登录 |
我写的程序在98下可用,但在XP下出现这样的提示 run-time error '453': can't find dll entry point registerserviceprocess in kernel32 请朋友们帮帮我,我是一个新手,但这个程序对我很重要.以下是代码 窗体 'winsock1客户器端口:8205 'winsock1服务器端口:8200 'winsock2客户端端口:8018 'winsock2服务器端口:8015 Private Sub Form_Initialize() If App.PrevInstance Then MsgBox "程序已经运行!", vbOKOnly, "提示" End End If End Sub Private Sub Form_Load() Dim my As String Dim Name As String, Length As Long Lyf1.HideApp True Length = 255 Name = String(Length, 0) GetComputerName Name, Length Name = Left(Name, Length) Form1.Caption = Name + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + Chr$(32) + CStr(Time) With Winsock1 my = .LocalIP .LocalPort = 8205 '设定本地端口 .RemotePort = 8200 '设定远程端口 .RemoteHost = "192.168.0.252" .Bind 8205 '绑定端口 End With Winsock1.SendData "kj" + Form1.Caption End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Winsock1.SendData "gj" + Form1.Caption End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Dim tmp As String Winsock1.GetData tmp, vbString On Error Resume Next If tmp = "重启" Or tmp = "重启" + Left(Form1.Caption, 3) Then Lyf1.ExitWin95 2: Exit Sub If tmp = "关机" Or tmp = "关机" + Left(Form1.Caption, 3) Then Lyf1.ExitWin95 3: Exit Sub If tmp = "刷新列表" Then Winsock1.SendData "kj" + Form1.Caption: Exit Sub If Left(tmp, 5) = "信息" + Left(Form1.Caption, 3) Then MsgBox Mid(tmp, 6), vbOKOnly + vbInformation, "网吧提示": Exit Sub If Left(tmp, 2) = "广播" Then MsgBox Mid(tmp, 3), vbOKOnly + vbInformation, "网吧提示": Exit Sub If tmp = "所有都运行" Or tmp = "运行" + Left(Form1.Caption, 3) Then Shell Mid(tmp, 6), vbNormalFocus End Sub 模块 Declare Function GetComputerName Lib "Kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long [此贴被 ljfgl(ljfgl) 在 04月14日17时22分 编辑过] |
地主 发表时间: 05-04-14 17:16 |
![]() | 回复: kenter1643 [kenter1643] ![]() |
登录 |
can't find dll entry point registerserviceprocess in kernel32 你没有注册这个dll组件 |
B1层 发表时间: 05-04-14 21:49 |
![]() | 回复: ljfgl [ljfgl] ![]() |
登录 |
要怎么做呢,在98下可以用呀 |
B2层 发表时间: 05-04-14 22:01 |
![]() | 回复: jhkdiy [jhkdiy] ![]() |
登录 |
问题应该不在GetComputerA函数上,而是调用ExitWindowEx函数来关闭或重起电脑上, 如果你的程序真的有关机功能, 那么在Win98下的关机实现和WinNT下的关机实现是不同的. 在Winnt中还有权限问题, 也就是要关机先要获取关机的权限. 具体实现可以到网上寻找有关资料. |
B3层 发表时间: 05-04-15 22:16 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号