Long,非零表示成功,零表示失败。会设置GetLastError If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError. 说
Long,非零表示成功,零表示失败。会设置GetLastError If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError. 说
api函数名:ConfigurePort
操作系统:Requires Windows 95 or later
参数表:
pName———— String,欲对其端口进行配置的一台服务器的名字。对于本地系统,请设为vbNullString
hwnd ———— Long,对话框父窗口的句柄
pPortName ————String,端口名
?pName————Points to a null-terminated string that specifies the name of the server on which the specified port exists. If this parameter is NULL, the port is local.
?hWnd————Identifies the parent window of the port-configuration dialog box.
?pPortName————Points to a null-terminated string that specifies the name of the port to be configured.
针对指定的端口,启动一个端口配置对话框 The ConfigurePort function displays the port-configuration dialog box for a port on the specified server. 声明:
Declare Function ConfigurePort Lib "winspool.drv" Alias "ConfigurePortA" (ByVal pName As String, ByVal hwnd As Long, ByVal pPortName As String) As Long
导入库:winspool.drv
***.Net中运用
命名空间 using System.Runtime.InteropServices;
导入库
函数原型 public static extern int ConfigurePort (string pName,int hwnd,string pPortName );
参数说明 //pName String,欲对其端口进行配置的一台服务器的名字
//hwnd Long,对话框父窗口的句柄
//pPortName String,端口名
返回值 非零表示成功,零表示失败。