+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
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 ...
  1. #1

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,756
    Thank Post
    3,265
    Thanked 1,052 Times in 973 Posts
    Rep Power
    365

    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 04:48 PM.

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,694
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    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 04:45 PM.

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,756
    Thank Post
    3,265
    Thanked 1,052 Times in 973 Posts
    Rep Power
    365
    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.

  4. #4

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,694
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by mac_shinobi View Post
    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

  5. #5

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,756
    Thank Post
    3,265
    Thanked 1,052 Times in 973 Posts
    Rep Power
    365
    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 ?

  6. #6

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,694
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by mac_shinobi View Post
    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

  7. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,756
    Thank Post
    3,265
    Thanked 1,052 Times in 973 Posts
    Rep Power
    365
    Quote Originally Posted by Steve21 View Post
    No prob at all. Is it basically just changing IE proxy, without reloading IE you're looking at?

    Steve
    To start with yes

  8. #8

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,919
    Thank Post
    1,626
    Thanked 1,893 Times in 1,407 Posts
    Blog Entries
    2
    Rep Power
    429
    My old app does that....

  9. #9


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,868
    Thank Post
    226
    Thanked 2,666 Times in 1,965 Posts
    Rep Power
    785

  10. Thanks to Arthur from:

    mac_shinobi (20th December 2011)

  11. #10

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,756
    Thank Post
    3,265
    Thanked 1,052 Times in 973 Posts
    Rep Power
    365
    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

  12. #11

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,756
    Thank Post
    3,265
    Thanked 1,052 Times in 973 Posts
    Rep Power
    365
    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 ?

  13. #12


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,868
    Thank Post
    226
    Thanked 2,666 Times in 1,965 Posts
    Rep Power
    785
    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?

  14. #13

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,756
    Thank Post
    3,265
    Thanked 1,052 Times in 973 Posts
    Rep Power
    365
    Quote Originally Posted by Arthur View Post
    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.

  15. #14

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,694
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by mac_shinobi View Post
    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

  16. Thanks to Steve21 from:

    mac_shinobi (21st December 2011)

  17. #15


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,868
    Thank Post
    226
    Thanked 2,666 Times in 1,965 Posts
    Rep Power
    785
    Quote Originally Posted by mac_shinobi View Post
    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

  18. Thanks to Arthur from:

    mac_shinobi (21st December 2011)

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Promethean to Smart conversion tool.
    By tscnmuk in forum Windows
    Replies: 8
    Last Post: 24th June 2014, 01:59 AM
  2. GUIDE: Promethean ACTIV software MSI conversion steps
    By ZeroHour in forum Educational Software
    Replies: 27
    Last Post: 21st March 2013, 08:23 AM
  3. SMART to Promethean conversion
    By budgester in forum Educational Software
    Replies: 7
    Last Post: 10th December 2010, 07:56 AM
  4. Video to VGA conversion
    By cinewlyn in forum Hardware
    Replies: 4
    Last Post: 12th December 2005, 01: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
  •