XP下网络连接问题,好郁闷,弄了好几天了,高手帮忙呀!!!!!!!!!!!!!!!!
le123 2006-08-25 04:34:08 net lst_h
lst_h.dwscope=0
lst_h.dwtype=0
lst_h.dwdisplaytype=0
lst_h.dwusage=0
lst_h.lplocalname=ls_driver
lst_h.lpremotename=ls_servername
lst_h.lpcomment=''
lst_h.lpProvider=''
long l_dwflag=0
long li_error
li_error=WNetAddConnection2(lst_h,ls_logword,ls_loguser,l_dwflag)
return li_error
------------funtction autoconn-----------
if WnetAddConnection(s_server,s_logpass,s_driver) = 0 then
//messagebox("新增映射","成功新增映射网络驱动器 " + upper(ls_drivername) + " !")
return true
else
return false
end if
------------function autonet-------------
function boolean CreateDirectoryA(ref string pathname,int sa) Library "Kernel32.dll"
FUNCTION ulong WNetAddConnection(ref string lpszNetPath,ref string lpszPassword,ref string lpszLocalName) LIBRARY "mpr.dll" ALIAS FOR "WNetAddConnectionA"
FUNCTION ulong WNetCancelConnection(ref string lpszName,boolean bForce) LIBRARY "mpr.dll" ALIAS FOR "WNetCancelConnectionA"
FUNCTION ulong WNetAddConnection2(ref NET lpNetResource,ref string lpPassword,ref string lpUserName,ulong dwFlags) LIBRARY "mpr.dll" ALIAS FOR "WNetAddConnection2A"
FUNCTION ulong WNetCancelConnection2(ref string lpName,ulong dwFlags,ulong fForce) LIBRARY "mpr.dll" ALIAS FOR "WNetCancelConnection2A"
=====================================
if ls_os="winnt" then
if autoconn(ls_server,ls_logid,ls_logpass,'') <>0 then
messagebox('提示:','登陆网络失败!')
halt
end if
else
if autonet(ls_server,'','')=false then
messagebox('提示:','登陆网络失败!')
halt
end if
end if
这段代码在调用时XP终端显示登录失败,但2000系统,2003系统都运行正常,请高手指点!!!!!!!!