Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted (edited)

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 -

 

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

Edited by Steve21
Posted

Just want to get it working in vb .net 2010 and in 2010 it is trying to make each one private, public etc

 


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.

Posted
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

Posted
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 ?
Posted
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

Posted

 

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 ?

Posted

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? :confused:

Posted
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? :confused:

 

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.

Posted
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 1
Posted
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.

 

"%UserProfile%\AppData\Local\Google\Chrome\Application\chrome.exe" --proxy-server http://proxy.domain.com:8080

  • Thanks 1
Posted

 

Will try to have a play around later, and see what I can do if you want

 

Steve

 

That would be great - thanks. I was just thinking instead of having 2 registry files and a batch file etc and naming them home, work and then merging those to the registry it would be nice to have a centered form where you have a list box and upon selecting each of the proxies which are shown as a name then it will load the relevant proxy settings into two text fields to start with ie

 

Proxy_One

Proxy_Two

Proxy_Three

 

If you select Proxy_One it then loads the server / ip address into text field one and the port into text field two which you can adjust / change and click save. Not sure on the best method of saving the proxy settings ie to an ini file / text file or to the registry and if to the registry then where abouts in the registry ?

 

I was hoping to add the options for :

 

* Manually setting a proxy

* Using a pac file

* Being able to use authentication on a proxy server etc

 

and possibly some other things but I just wanted the basic manual proxy setting and it being able to save / edit the proxy settings and being able to re call the settings that were last saved

Posted
You might also be interested in @painejake 's Proxy Switch program. It is written in C# and the source code is available here.

 

Btw, do you still use Advanced Proxy Manager? I assume you want to create something similar?

 

Not yet - although that does look good ( Advanced Proxy Manager ), will look at Proxy Switch in a bit

 

Would be nice to make something and go through the code to see what it does etc

Posted
That would be great - thanks. I was just thinking instead of having 2 registry files and a batch file etc and naming them home, work and then merging those to the registry it would be nice to have a centered form where you have a list box and upon selecting each of the proxies which are shown as a name then it will load the relevant proxy settings into two text fields to start with ie

 

 

 

It's only an "extremely" rough version, to see if I understood what you mean, but something like my attached exe? (Note, Not much error checking etc, and only tested it on IE)

 

TestProxyChanger.zip

 

Basically it loads a set of proxies from registry (and the one you have currently set in IE), you can type whatever you want it, Hit load and it'll set IE + Change without reload.

 

Not done any saving back to reg yet etc, just wanted to see if that was what you meant.

 

Thanks,

Steve

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...