使用PB调用API自动更新(非FTP模式)(三、连接函数F_CONNECT_COPYSERVER)

王朝other·作者佚名  2006-01-09
宽屏版  字体: |||超大  

三、连接函数F_CONNECT_COPYSERVER

返回路径

global type f_connect_copyserver from function_object

end type

forward prototypes

global function string f_connect_copyserver ()

end prototypes

global function string f_connect_copyserver ();

STRING GS_COPYSERVER1

STRING GS_COPYSERVER2

STRING GS_COPYSERVER3

STRING GS_COPYLOGINUSER1

STRING GS_COPYLOGINUSER2

STRING GS_COPYLOGINUSER3

STRING GS_COPYLOGINPASS1

STRING GS_COPYLOGINPASS2

STRING GS_COPYLOGINPASS3

GS_COPYSERVER1 = ProfileString("autodown.ini","downpath","COPYSERVER1","")

GS_COPYSERVER2 = ProfileString("autodown.ini","downpath","COPYSERVER2","")

GS_COPYSERVER3 = ProfileString("autodown.ini","downpath","COPYSERVER3","")

GS_COPYLOGINUSER1 = ProfileString("autodown.ini","downpath","COPYLOGINUSER1","")

GS_COPYLOGINUSER2 = ProfileString("autodown.ini","downpath","COPYLOGINUSER2","")

GS_COPYLOGINUSER3 = ProfileString("autodown.ini","downpath","COPYLOGINUSER3","")

GS_COPYLOGINPASS1 = ProfileString("autodown.ini","downpath","COPYLOGINPASS1","")

GS_COPYLOGINPASS2 = ProfileString("autodown.ini","downpath","COPYLOGINPASS2","")

GS_COPYLOGINPASS3 = ProfileString("autodown.ini","downpath","COPYLOGINPASS3","")

s_netresource ss_net

ss_net.dwScope = 0

ss_net.dwType = 0//

ss_net.dwDisplayType = 0

ss_net.dwUsage = 0

ss_net.lpLocalName = ''//

ss_net.lpRemoteName = GS_COPYSERVER1//

ss_net.lpComment = ''

ss_net.lpProvider = ''//

long ll_ret

string ls_path

ls_path = ''

ll_ret = WNetGetConnectionA('',GS_COPYSERVER1,255)

if ll_ret <> 0 then

ll_ret = WNetGetConnectionA('',GS_COPYSERVER2,255)

if ll_ret <> 0 then

ll_ret = WNetGetConnectionA('',GS_COPYSERVER3,255)

if ll_ret = 0 then

return GS_COPYSERVER3

end if

else

return GS_COPYSERVER2

end if

else

return GS_COPYSERVER1

end if

//gl_handle,

ll_ret = WNetAddConnection2A(ss_net,GS_COPYLOGINPASS1,GS_COPYLOGINUSER1,1)

if ll_ret <> 0 then

ss_net.dwScope = 0

ss_net.dwType = 0//

ss_net.dwDisplayType = 0

ss_net.dwUsage = 0

ss_net.lpLocalName = ''//

ss_net.lpRemoteName = GS_COPYSERVER2//

ss_net.lpComment = ''

ss_net.lpProvider = ''//

ll_ret = WNetAddConnection2A(ss_net,GS_COPYLOGINPASS2,GS_COPYLOGINUSER2,1)

if ll_ret <> 0 then

ss_net.dwScope = 0

ss_net.dwType = 0//

ss_net.dwDisplayType = 0

ss_net.dwUsage = 0

ss_net.lpLocalName = ''//

ss_net.lpRemoteName = GS_COPYSERVER3//

ss_net.lpComment = ''

ss_net.lpProvider = ''//

ll_ret = WNetAddConnection2A(ss_net,GS_COPYLOGINPASS3,GS_COPYLOGINUSER3,1)

if ll_ret <> 0 then

//messagebox('错误!','连接服务器错误!',stopsign!)

return ls_path

end if

ls_path = GS_COPYSERVER3

else

ls_path = GS_COPYSERVER2

end if

else

ls_path = GS_COPYSERVER1

end if

if isnull(ls_path) then ls_path = ''

//messagebox('',ls_path)

return ls_path

end function

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有