Using a proxy in a web browser

please help......i have a presentation in the morning :(

Page 1 of 1

13 Replies - 12183 Views - Last Post: 25 August 2008 - 12:47 PM Rate Topic: -----

#1 richard356  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 03-August 08

Using a proxy in a web browser

Posted 03 August 2008 - 07:08 PM

 Public Class mainform

	Private Sub webBrowser1_StatusTextChanged( _
		ByVal sender As Object, ByVal e As EventArgs) _
		Handles WebBrowser1.StatusTextChanged

	   TextBox5.Text = WebBrowser1.StatusText
	
End Sub
	Private Sub webBrowser1_Navigated(ByVal sender As Object, _
			ByVal e As WebBrowserNavigatedEventArgs) _
			Handles WebBrowser1.Navigated

	   TextBox1.Text = WebBrowser1.Url.ToString()

   End Sub

	Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

	End Sub

	Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
		WebBrowser1.Refresh()
	End Sub
End Class

This post has been edited by richard356: 03 August 2008 - 07:30 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Using a proxy in a web browser

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Using a proxy in a web browser

Posted 03 August 2008 - 08:39 PM

What is the problem you're having?
Was This Post Helpful? 0
  • +
  • -

#3 richard356  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 03-August 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 09:05 PM

View PostPsychoCoder, on 3 Aug, 2008 - 08:39 PM, said:

What is the problem you're having?


I have no idea of how to do. I would greatly appreciate you help. thanks.
Was This Post Helpful? 0
  • +
  • -

#4 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 40
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 10:29 PM

What exactly is your problem that you are having?
Was This Post Helpful? 0
  • +
  • -

#5 richard356  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 03-August 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 10:38 PM

Thanks for helping me and i ment to take that out. I just want to make the basic webbrowser control with a proxy.
Was This Post Helpful? 0
  • +
  • -

#6 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 40
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 10:40 PM

Ok so what exactly do you need my help with?
Was This Post Helpful? 0
  • +
  • -

#7 richard356  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 03-August 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 10:43 PM

i dont know how to make the webbrowser go through a proxy for example e.g. proxy 123.123.123.1234 and port:1234
Was This Post Helpful? 0
  • +
  • -

#8 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 40
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 10:46 PM

Tell me if this helps

			Int32 port = 1234;
			String server = "123.123.123.1234";
			System.Net.WebProxy proxy = new System.Net.WebProxy(server, port);


Was This Post Helpful? 0
  • +
  • -

#9 richard356  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 03-August 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 10:47 PM

View Postgbertoli3, on 3 Aug, 2008 - 10:46 PM, said:

Tell me if this helps

			Int32 port = 1234;
			String server = "123.123.123.1234";
			System.Net.WebProxy proxy = new System.Net.WebProxy(server, port);



im new to all of this so could you tell me where to put it?
Was This Post Helpful? 0
  • +
  • -

#10 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 40
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 10:49 PM

I don't know if this will work but I modified it a little

Sorry but I just realized that I was posting in C#, when I should've posted in VB.NET
Here you Are
Private Sub webBrowser_Navigating(ByVal sender As Object, ByVal e As WebBrowserNavigatingEventArgs)
  Dim port As Int32 = 1234
  Dim server As String = "123.123.123.1234"
  Dim proxy As New System.Net.WebProxy(server, port)
  If proxy Is Nothing Then
    e.Cancel = True
  End If
End Sub


Was This Post Helpful? 1
  • +
  • -

#11 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 40
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 10:56 PM

So does it work?

To be honest I don't know much about proxies and I am not an expert in VB.NET I just know good amount
Was This Post Helpful? 0
  • +
  • -

#12 richard356  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 03-August 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 11:01 PM

View Postgbertoli3, on 3 Aug, 2008 - 10:56 PM, said:

So does it work?

To be honest I don't know much about proxies and I am not an expert in VB.NET I just know good amount



It doesnt seem to be throwing me any errors so im guessing that it is working

thanks for helping a random in need
Was This Post Helpful? 0
  • +
  • -

#13 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 40
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Re: Using a proxy in a web browser

Posted 03 August 2008 - 11:06 PM

Sure no problem let me know if you need anything else
Was This Post Helpful? 0
  • +
  • -

#14 Quassi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 25-August 08

Re: Using a proxy in a web browser

Posted 25 August 2008 - 12:47 PM

Hi,

This will work with the webbrowser control.

I'm using DownloadFile. Does anybody know how to do this via a proxy?

My method:

		Dim MyWebClient As New WebClient
		Dim sMessage As String

		Try
			MyWebClient.DownloadFile(sFullImageURL, sLocalFileName)
			MyWebClient.GetLifetimeService()

		Catch ex As Exception
			If InStr(ex.Message, "404") Then
				sMessage = "offline!"
			Else
				sMessage = ex.Message
			End If

		End Try






			Int32 port = 1234;
			String server = "123.123.123.1234";
			System.Net.WebProxy proxy = new System.Net.WebProxy(server, port);


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1