Before you say "use the search button" I did. I got the following code but I have an error:
The error is with "InternetSetOption" and the error says:The name 'InternetSetOption' does not exist in the current context
Can you help?
bumnp....................
Code:
public struct Struct_INTERNET_PROXY_INFO
{
public int dwAccessType;
public IntPtr proxy;
public IntPtr proxyBypass;
}
#region "Proxy"
// The Windows API function that allows us to manipulate
// IE settings programmatically.
// The function we will be using to set the proxy settings.
// ERROR: Not supported in C#: DeclareDeclaration
private void RefreshIESettings(string strProxy)
{
const int INTERNET_OPTION_PROXY = 38;
const int INTERNET_OPEN_TYPE_PROXY = 3;
Struct_INTERNET_PROXY_INFO struct_IPI = default(Struct_INTERNET_PROXY_INFO);
// Filling in structure
struct_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY;
struct_IPI.proxy = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(strProxy);
struct_IPI.proxyBypass = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi("local");
// Allocating memory
IntPtr intptrStruct = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(System.Runtime.InteropServices.Marshal.SizeOf(struct_IPI));
// Converting structure to IntPtr
System.Runtime.InteropServices.Marshal.StructureToPtr(struct_IPI, intptrStruct, true);
bool iReturn = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, System.Runtime.InteropServices.Marshal.SizeOf(struct_IPI));
}
#endregion
The error is with "InternetSetOption" and the error says:The name 'InternetSetOption' does not exist in the current context
Can you help?
bumnp....................