七、下載代碼
string gs_copyserver1
string gs_copyserver2
string gs_copyserver3
string ls_path
string ls_mypath
long ll_count = 0
gs_copyserver1 = profilestring("autodown.ini","downpath","copyserver1","")
gs_copyserver2 = profilestring("autodown.ini","downpath","copyserver2","")
gs_copyserver3 = profilestring("autodown.ini","downpath","copyserver3","")
st_ts.text = '正在檢查需要更新軟件的數量...'
ls_path = gs_copyserver1
ll_count = f_connect_copycount(ls_path,lb_files1,lb_files2,lb_files3)
if ll_count = -1 then
ls_path = gs_copyserver2
ll_count = f_connect_copycount(ls_path,lb_files1,lb_files2,lb_files3)
if ll_count = -1 then
ls_path = gs_copyserver3
ll_count = f_connect_copycount(ls_path,lb_files1,lb_files2,lb_files3)
if ll_count = -1 then
st_ts.text = '正在檢查是否需要更新軟件版本...'
ls_path = f_connect_copyserver()
if ls_path = '' then
messagebox('連接錯誤!','無法連接服務器!軟件不能運行!',stopsign!)
//close(this)
return
end if
end if
end if
end if
//messagebox('',ls_path)ls_path<> ''
if ll_count = -1 then
st_ts.text = '正在檢查需要更新軟件的數量...'
ll_count = f_connect_copycount(ls_path,lb_files1,lb_files2,lb_files3)
end if
if ll_count = -1 then
messagebox('連接錯誤!','無法連接服務器!軟件不能運行!',stopsign!)
close(this)
return
end if
if ll_count = 0 then
st_ts.text = '正在啟動主程序...'
else
st_ts.text = '正在更新軟件版本...'
choose case f_connect_copyfile(ls_path,hpb_1,ll_count,lb_files1,lb_files2,lb_files3)
case 1
st_ts.text = '正在啟動主程序...'
case 2 //啟動參數不同,以便賦值更新程序
st_ts.text = '正在啟動主程序...'
end choose
end if
string ls_file
ls_file = gs_application_path + '/xxxxx.exe qqaazzwwss'
run(ls_file)
//close(this)