Coding Thread, Conversion in Coding and Web Development; Change Proxy Without Having to Restart Internet Explorer - VBForums
The above has the code for vb 6 but with ...
-
19th December 2011, 05:30 PM #1 Conversion
Change Proxy Without Having to Restart Internet Explorer - VBForums
The above has the code for vb 6 but with the Private Type's being changed to Private Structure's and not using vbUnicode etc I am getting a bit confused
Also this example :
http://runegear.net/showthread.php?tid=5570
But the Marshal Side of things is not working
Last edited by mac_shinobi; 19th December 2011 at 05:48 PM.
-
-
IDG Tech News
-
19th December 2011, 05:36 PM #2 What's the actual question? :P Bit confused.
Edit - I'm assuming you're asking why isn't a type a structure?
If so, it depends what you're coding in.
vb6 = type, vb.net = structure. "Basically" same thing though.
Edit 2 -
Code:
vb6
Private Type INTERNET_PER_CONN_OPTION
dwOption As Long
dwValue1 As Long
dwValue2 As Long
End Type
vb.net
Structure INTERNET_PER_CONN_OPTION
Dim dwOption As Long
Dim dwValue1 As Long
Dim dwValue2 As Long
End Structure etc
Steve
Last edited by Steve21; 19th December 2011 at 05:45 PM.
-
-
19th December 2011, 06:00 PM #3 Just want to get it working in vb .net 2010 and in 2010 it is trying to make each one private, public etc
Code:
Structure INTERNET_PER_CONN_OPTION
private dwOption As Long
private dwValue1 As Long
private dwValue2 As Long
End Structure Presume it would be better to get the first example working as think this is the correct method, not doing it short handed as per the 2nd link which is using the wininet.dll file's functions.
-
-
19th December 2011, 06:03 PM #4 
Originally Posted by
mac_shinobi
Just want to get it working in vb .net 2010 and in 2010 it is trying to make each one private, public etc
vb6 isn't .NET though. Different language "as such". You will need to change a lot of things, as things like "type" don't exist anymore in vb.net, it's all changed. In .NET it's structures, and it "has" to have a "type", aka public or private etc. If you just "dim" it, it'll be public by default, or as I did before add private etc
Steve
-
-
19th December 2011, 06:08 PM #5 will play around with it over the next week or so as will need to google how to use structures instead of types and muck around with it a bit. Will drop you a pm if I have any questions etc, if that is ok ?
-
-
19th December 2011, 06:58 PM #6 
Originally Posted by
mac_shinobi
will play around with it over the next week or so as will need to google how to use structures instead of types and muck around with it a bit. Will drop you a pm if I have any questions etc, if that is ok ?
No prob at all. Is it basically just changing IE proxy, without reloading IE you're looking at?
Steve
-
-
19th December 2011, 08:33 PM #7 
Originally Posted by
Steve21
No prob at all. Is it basically just changing IE proxy, without reloading IE you're looking at?
Steve
To start with yes
-
-
19th December 2011, 08:57 PM #8
-
-
19th December 2011, 10:14 PM #9
-
Thanks to Arthur from:
mac_shinobi (20th December 2011)
-
20th December 2011, 03:29 PM #10 
Originally Posted by
Arthur
Only if I try and code it in c# , otherwise I am still stuck trying to convert the code. I suppose I could try c sharp instead of vb.net
-
-
20th December 2011, 03:35 PM #11 
Originally Posted by
Arthur
Does the massive chunk of code go into a module and the 2 functions to set and remove the proxy settings go into the same chunk of code outside of the button click events etc ( within the main class )
you then call these from within the button click event etc ?
-
-
20th December 2011, 06:58 PM #12 The example above is a PowerShell script which compiles the C# code contained in PoshHttp.Proxies.cs straight into memory when it is executed. Set-Proxy and Remove-Proxy are then exported as functions into your PowerShell session.
You don't necessarily have to use the PowerShell part of the script though. What exactly are you trying to do?
-
-
21st December 2011, 09:04 AM #13 
Originally Posted by
Arthur
The example above is a PowerShell script which compiles the C# code contained in PoshHttp.Proxies.cs straight into memory when it is executed. Set-Proxy and Remove-Proxy are then exported as functions into your PowerShell session.
You don't necessarily have to use the PowerShell part of the script though. What exactly are you trying to do?

I don't always use internet explorer and although chrome relies on IE settings, it does not work correctly at work and thus use firefox.
Basically I wanted to make my own proxy switch utility that I could use on my work desktop so that I could just right click on a system tray icon -> set my own proxies up and have each of these proxies appear in the right click pop up menu so I can easily switch between them and set firefox to use IE settings ( system settings ) and then I can adjust these by changing the IE settings on the fly in the system tray
I can play around with this over the christmas period.
-
-
21st December 2011, 09:13 AM #14 
Originally Posted by
mac_shinobi
I don't always use internet explorer and although chrome relies on IE settings, it does not work correctly at work and thus use firefox.
Basically I wanted to make my own proxy switch utility that I could use on my work desktop so that I could just right click on a system tray icon -> set my own proxies up and have each of these proxies appear in the right click pop up menu so I can easily switch between them and set firefox to use IE settings ( system settings ) and then I can adjust these by changing the IE settings on the fly in the system tray
I can play around with this over the christmas period.
The thing is (as far as I know), majority of browsers only load reg settings at the loading point of them. Thus some of the older vb6 versions etc are using old .dll's which force the browser to refresh settings (aka reload the registry).
The issue you'll have is will FF/Chrome etc reload the registry settings even if you change them? If not, it might be easier just to change settings, and make the program auto reload the browser? (Or do you need it to stay open for some reason?)
Will try to have a play around later, and see what I can do if you want
Steve
-
Thanks to Steve21 from:
mac_shinobi (21st December 2011)
-
21st December 2011, 09:52 AM #15 
Originally Posted by
mac_shinobi
although Chrome relies on IE settings, it does not work correctly at work and thus use Firefox.
Probably of no use whatsoever, but you can set Chrome's proxy via the command-line.
Code:
"%UserProfile%\AppData\Local\Google\Chrome\Application\chrome.exe" --proxy-server http://proxy.domain.com:8080
-
Thanks to Arthur from:
mac_shinobi (21st December 2011)
SHARE:
Similar Threads
-
By budgester in forum Educational Software
Replies: 7
Last Post: 10th December 2010, 08:56 AM
-
By ZeroHour in forum Educational Software
Replies: 26
Last Post: 9th September 2009, 12:32 PM
-
By tscnmuk in forum Windows
Replies: 7
Last Post: 9th May 2007, 02:45 PM
-
By cinewlyn in forum Hardware
Replies: 4
Last Post: 12th December 2005, 02:32 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules