Dotinho Posted August 25, 2009 at 07:32 AM Report #284420 Posted August 25, 2009 at 07:32 AM Boas, tenho uma questão que acho que é compliado... É assim, alguns sites tipo "fileshare" dao para usar proxyes, então fiz um programa que se actualiza com o site http://www.proxy4free.com/page1.html. Extrai a lista de proxyese vai mudando sozinho.. O problema é que o webbrowser nao tem nenhum opção para enfiar um proxy, alguem tem alguma sugestão? cmps Luis Lourenço
Dotinho Posted August 25, 2009 at 08:24 AM Author Report #284421 Posted August 25, 2009 at 08:24 AM já encontrei aqui http://vbdotnetforum.com/index.php?/topic/503-use-proxy-with-web-browser-control/ <Runtime.InteropServices.DllImport("wininet.dll", SetLastError:=True)> _ Private Shared Function InternetSetOption(ByVal hInternet As IntPtr, ByVal dwOption As Integer, ByVal lpBuffer As IntPtr, ByVal lpdwBufferLength As Integer) As Boolean End Function Public Structure Struct_INTERNET_PROXY_INFO Public dwAccessType As Integer Public proxy As IntPtr Public proxyBypass As IntPtr End Structure Private Sub RefreshIESettings(ByVal strProxy As String) Const INTERNET_OPTION_PROXY As Integer = 38 Const INTERNET_OPEN_TYPE_PROXY As Integer = 3 Dim struct_IPI As Struct_INTERNET_PROXY_INFO ' Filling in structure struct_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY struct_IPI.proxy = Marshal.StringToHGlobalAnsi(strProxy) struct_IPI.proxyBypass = Marshal.StringToHGlobalAnsi("local") ' Allocating memory Dim intptrStruct As IntPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(struct_IPI)) ' Converting structure to IntPtr Marshal.StructureToPtr(struct_IPI, intptrStruct, True) Dim iReturn As Boolean = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, System.Runtime.InteropServices.Marshal.SizeOf(struct_IPI)) End Sub Não esqeucer de Importar Systems.Runtime.Interop e usa-se RefreshIESettings("125.125.36.25:80") Luis Lourenço
Dotinho Posted August 25, 2009 at 10:34 AM Author Report #284431 Posted August 25, 2009 at 10:34 AM Se alguem mais ideias ou sugestões.. Fica aqui o sourccode e o printscreen da form. http://www.filedropper.com/proxysautomaticos http://a.imagehost.org/view/0280/proxy_auto http://a.imagehost.org/view/0091/Sem_t_tulo_10 Luis Lourenço
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now