Wininet InternetErrorDlg proxy

来源:互联网 发布:用友软件销售好做吗 编辑:程序博客网 时间:2024/06/06 20:07
I want to read an internet html-file, my program has to work with and 
without proxyserver. 

I am using the following Dlls (in case no proxyserver without 
authentication): 
InternetOpen, InternetOpenUrl,InternetReadFile and InternetCloseHandle. 
this is working well. 

In case of proxyserver I am looking for help: 
I am using the following Dlls: 
InternetOpen,InternetConnect,HttpOpenRequest,HttpSendRequest,InternetReadFil 
e and InternetCloseHandle. 
How can I obtain (on the client machine) the name of the proxy server and 
the authenticated user? 
Maybe I could show the InternetErrorDlg()-Dialog. 
But the dialog is not shown when running my code; here is my code to show 
the dialog (the return value is 6, no dialog is shown) 

.... 
hsession = InternetOpen(mc_USER_AGENT, INTERNET_OPEN_TYPE_PRECONFIG, 
vbNullString, vbNullString, 0) 
If hsession Then 
hconnection = InternetConnect(hsession, sRemoteHost, 
INTERNET_INVALID_PORT_NUMBER, vbNullString,vbNullString, 
INTERNET_SERVICE_HTTP, 0, 0) 
If hconnection Then 
hInternet = HttpOpenRequest(hconnection, "GET", strurl, "HTTP/1.0", 
vbNullString, 0, INTERNET_FLAG_RELOAD, 0) 
If hInternet Then 
bres = HttpSendRequest(hInternet, vbNullString, 0, vbNullString, 0) 
geterrdlg(hInternet) 
.... 

Private Sub geterrdlg(hrequest As Long) 
Dim lRet As Long 
lRet = InternetErrorDlg(App.hInstance, hrequest, 
ERROR_INTERNET_INCORRECT_PASSWORD, FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS, 
vbNullString) 
End Sub 

I use VB6. 

Thank you very much for any help. 

Best regards 
Roswitha 
0 0
原创粉丝点击