當前位置:首頁 » 代理許可 » as設置代理

as設置代理

發布時間: 2020-11-24 09:43:56

① c#中的httpclient post如何設置代理IP高分求答案。

下面是我之前做過的 Get 請求時用的,代理的代碼,是可行
var req = WebRequest.Create(url) as HttpWebRequest;
// 設置代理版權
var /w/e/b/P/r/o/x/y = new /W/e/b/P/r/o/x/y(代理 Ip, 代理埠);

② C#如何實現IE代理設置

C#設置IE代理可以通過修改注冊表來實現,實現代碼:
1、修改注冊表:

//打開注冊表
Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
//設置代理
rk.SetValue("ProxyEnable", 1);
rk.SetValue("ProxyServer", "8.8.8.8:8000");
//取消代理
//rk.SetValue("ProxyEnable", 0);

rk.Flush(); //刷新注冊表
rk.Close();
2、調用WinInet API ,激活代理設置:
[DllImport(@"wininet",
SetLastError = true,
CharSet = CharSet.Auto,
EntryPoint = "InternetSetOption",
CallingConvention = CallingConvention.StdCall)]
public static extern bool InternetSetOption(
int hInternet,
int dmOption,
IntPtr lpBuffer,
int dwBufferLength
);

void SetProxy() {
//打開注冊表
Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
//設置代理
rk.SetValue("ProxyEnable", 1);
rk.SetValue("ProxyServer", "8.8.8.8:8000");
//取消代理
//rk.SetValue("ProxyEnable", 0);

rk.Flush(); //刷新注冊表
rk.Close();
//激活代理設置
InternetSetOption(0, 39, IntPtr.Zero, 0);
InternetSetOption(0, 37, IntPtr.Zero, 0);
}
另一種不需要修改注冊表的方法,代碼如下:
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;

namespace PoshHttp
{
public class Proxies
{
public static bool UnsetProxy()
{
return SetProxy(null, null);
}
public static bool SetProxy(string strProxy)
{
return SetProxy(strProxy, null);
}

public static bool SetProxy(string strProxy, string exceptions)
{
InternetPerConnOptionList list = new InternetPerConnOptionList();

int optionCount = string.IsNullOrEmpty(strProxy) ? 1 : (string.IsNullOrEmpty(exceptions) ? 2 : 3);
InternetConnectionOption[] options = new InternetConnectionOption[optionCount];
// USE a proxy server ...
options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY));
// use THIS proxy server
if (optionCount > 1)
{
options[1].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER;
options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy);
// except for these addresses ...
if (optionCount > 2)
{
options[2].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_BYPASS;
options[2].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(exceptions);
}
}

// default stuff
list.dwSize = Marshal.SizeOf(list);
list.szConnection = IntPtr.Zero;
list.dwOptionCount = options.Length;
list.dwOptionError = 0;

int optSize = Marshal.SizeOf(typeof(InternetConnectionOption));
// make a pointer out of all that ...
IntPtr optionsPtr = Marshal.AllocCoTaskMem(optSize * options.Length);
// the array over into that spot in memory ...
for (int i = 0; i < options.Length; ++i)
{
IntPtr opt = new IntPtr(optionsPtr.ToInt32() + (i * optSize));
Marshal.StructureToPtr(options[i], opt, false);
}

list.options = optionsPtr;

// and then make a pointer out of the whole list
IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((Int32)list.dwSize);
Marshal.StructureToPtr(list, ipcoListPtr, false);

// and finally, call the API method!
int returnvalue = NativeMethods.InternetSetOption(IntPtr.Zero,
InternetOption.INTERNET_OPTION_PER_CONNECTION_OPTION,
ipcoListPtr, list.dwSize) ? -1 : 0;
if (returnvalue == 0)
{ // get the error codes, they might be helpful
returnvalue = Marshal.GetLastWin32Error();
}
// FREE the data ASAP
Marshal.FreeCoTaskMem(optionsPtr);
Marshal.FreeCoTaskMem(ipcoListPtr);
if (returnvalue > 0)
{ // throw the error codes, they might be helpful
throw new Win32Exception(Marshal.GetLastWin32Error());
}

return (returnvalue < 0);
}
}

#region WinInet structures
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct InternetPerConnOptionList
{
public int dwSize; // size of the INTERNET_PER_CONN_OPTION_LIST struct
public IntPtr szConnection; // connection name to set/query options
public int dwOptionCount; // number of options to set/query
public int dwOptionError; // on error, which option failed
//[MarshalAs(UnmanagedType.)]
public IntPtr options;
};

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct InternetConnectionOption
{
static readonly int Size;
public PerConnOption m_Option;
public InternetConnectionOptionValue m_Value;
static InternetConnectionOption()
{
InternetConnectionOption.Size = Marshal.SizeOf(typeof(InternetConnectionOption));
}

// Nested Types
[StructLayout(LayoutKind.Explicit)]
public struct InternetConnectionOptionValue
{
// Fields
[FieldOffset(0)]
public System.Runtime.InteropServices.ComTypes.FILETIME m_FileTime;
[FieldOffset(0)]
public int m_Int;
[FieldOffset(0)]
public IntPtr m_StringPtr;
}
}
#endregion

#region WinInet enums
//
// options manifests for Internet{Query|Set}Option
//
public enum InternetOption : uint
{
INTERNET_OPTION_PER_CONNECTION_OPTION = 75
}

//
// Options used in INTERNET_PER_CONN_OPTON struct
//
public enum PerConnOption
{
INTERNET_PER_CONN_FLAGS = 1, // Sets or retrieves the connection type. The Value member will contain one or more of the values from PerConnFlags
INTERNET_PER_CONN_PROXY_SERVER = 2, // Sets or retrieves a string containing the proxy servers.
INTERNET_PER_CONN_PROXY_BYPASS = 3, // Sets or retrieves a string containing the URLs that do not use the proxy server.
INTERNET_PER_CONN_AUTOCONFIG_URL = 4//, // Sets or retrieves a string containing the URL to the automatic configuration script.

}

//
// PER_CONN_FLAGS
//
[Flags]
public enum PerConnFlags
{
PROXY_TYPE_DIRECT = 0x00000001, // direct to net
PROXY_TYPE_PROXY = 0x00000002, // via named proxy
PROXY_TYPE_AUTO_PROXY_URL = 0x00000004, // autoproxy URL
PROXY_TYPE_AUTO_DETECT = 0x00000008 // use autoproxy detection
}
#endregion

internal static class NativeMethods
{
[DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool InternetSetOption(IntPtr hInternet, InternetOption dwOption, IntPtr lpBuffer, int dwBufferLength);
}
}

③ 各位大蝦,as3.0的htmlloader.userAgent設置ie代理的字元串是什麼,謝謝!

HTMLLoader 對象繼承 Adobe® Flash® Player Sprite 類的顯示屬性。例如,可以調整大小、移動、隱藏和更改背景顏色,也可以應用濾鏡、遮罩、縮放和旋轉等高級效果。
在應用效果時,應考慮對易讀性的影響。在應用某些效果時,無法顯示載入到 HTML 頁中的 SWF 和 PDF 內容。
HTML 窗口包含用於呈現 HTML 內容的 HTMLLoader 對象。
此對象被限制在窗口區域內,因此,更改尺寸、位置、旋轉或縮放系數並不一定能得到令人滿意的結果。

④ 怎麼設置as的proxy setting

主要說有四個升級選項,建議使用stable channel,
File > Settings > Appearance & Behavior System Settings > Updates
更改選項

⑤ Android studio怎麼設置HTTP協議代理

工具:
android studio

1、打開了android studio的開發代碼工具之後,進行到界面中,進行點擊菜單中的「file」的選項菜內單;

2、就會彈出了下容拉的菜單中進行選中「setting」的菜單;

3、就會彈出了settings的窗口中,進行選中列表菜單中的appearance&behavior的選項;

4、然後就會彈出了下拉列表中進行選中system settings中後進行選中http proxy的選項;

5、進入到了http proxy的界面中之後,進行選中manual proxy configuration的選項後;

6、這樣就可以在host name中進行輸入代理軟體的鏈接地址信息,及埠號port number,然後進行點擊OK

⑥ geckoWebBrowser 怎麼設置代理伺服器地址

Private Type INTERNET_PROXY_INFO
dwAccessType As Long
lpszProxy As String
lpszProxyBypass As String
End Type
Private Const INTERNET_OPEN_TYPE_PROXY = 3
Private Const INTERNET_OPTION_PROXY = 38
Private Const INTERNET_OPTION_SETTINGS_CHANGED = 39
Private Declare Function internetsetoption Lib "WinInet.dll" Alias "InternetSetOptionA" (ByVal hinternet As Long, ByVal dwoption As Long, ByRef lpBuffer As Any, ByVal dwbufferlength As Long) As Long

Dim options As INTERNET_PROXY_INFO
options.dwAccessType = INTERNET_OPEN_TYPE_PROXY
options.lpszProxy = "SOCKS=IP:埠" '如果是http代理就是HTTP=IP:埠
options.lpszProxyBypass = ""
internetsetoption 0, INTERNET_OPTION_PROXY, options, LenB(options)
internetsetoption 0, INTERNET_OPTION_SETTINGS_CHANGED, 0, 0

⑦ as的proxy 需要設置代理么

公司里上網是通過公司自己做的代理,因此使用Rubygem的時候沒有辦法直接安裝我們需要的包如Rails,在網上查了很多的有關gem使用代理的方法,很多人都寫到gem支持-p參數來設定代理,但是我試了很久沒有成功。 現在把我設置成功的方法記下來,以免以後忘掉:
在windows里有兩種,第一種是使用代理軟體,這個我就不說了,自己看著辦吧;
第二種,在命令行下輸入:set http_proxy=url,後面的url是你的代理地址,如:http://192.168.0.1:8081什麼的。設置完後就可以直接使用gem命令了。

⑧ 請高手進,詳細請教。如何突破公司內網限制 (破解,代理,各種方法都可以,只求可以瀏覽起點。。。。。

你好!你的電腦可以ping通那台可以上外網的電腦么?
可以的話就成功了一半。可以使用PacketiX VPN 。具體可以
參考我的博客http://blog.sina.com.cn/asqty
復雜一點的,可以搭建openvpn,有不懂的地方可以HI我。

⑨ 3dmax面數太怎麼換成VR代理物體求詳細步驟!

vray 代理的作用就是用在大場景當中,可是支持超高面的場景,而不佔用太多的資源。
Part 1:理論概念

你將會知道代理物體能做什麼,現在我來解釋一下它是怎麼樣工作的。代理物體是能讓你僅僅在渲染時從外部文件導入網格物體的物體。這樣可以在你的場景的工作中節省大量的內存。打個比方,你使用很多高精度的樹的模型而你不需要一直在視圖里看到它們。將它們導出為V-Ray代理物體,你可以加快你的工作流程,而且你能夠渲染更多的多邊形。

如果你想要導入網格物體,你需要先把它導出。這是很明顯的。你可以用2個簡單的方法來導出:

1.選擇你的物體。點擊滑鼠右鍵並在彈出的菜單里選擇:"V-Ray mesh export"選項。
2.選擇你的物體並寫下這樣的腳本:"doVRayMeshExport()"。
這2個方法都會讓V-Ray mesh export對話框出現。這里對它的選項進行說明:

Folder - 理所當然的這里是設置你的網格物體的保存路徑。
Export as single file - 當你導出2個或2個以上的物體它會將它們合並成一個V-Ray代理網格物體。
File - 網格物體的名字。
Export as multiplie files - 選擇這個的話,V-Ray會對每一個物體創建一個文件。
Automatically create proxies - 它將導出並創建代理物體。連同材質在內的所有改變都是動態完成的。但是你所選擇導出的物體將會被刪除。

- 要記住如果你想要導出網格物體的話,它必須是准備渲染的。你是沒有辦法修改V-Ray網格物體的。
- V-Ray代理物體可以在V-Ray部分的下拉菜單里找到。
- 這就是關於這個理論概念的所有的東西。現在記住一些有用的技巧。
- 當你想創建一個物體的復合代理物體,最好的方法就是創建一個然後關聯復制。
Part 2:V-Ray代理物體的使用
a.首先打開一個高精度模型M
b.把他們按ID材質合並attach在一起M
c.選種合後的物體M點滑鼠右鍵選擇vray mesh export
d.窗口彈出按需要設置存的路徑,代理方式,和代理動態
e.ok後選擇已經代理的代理物體,在修改面板可以設置它的顯示方式(box還是原形)
f.最重要的一點是代理物體最好是最終渲染對象,材質變為一個多維材質並存出去,因為代理物體會丟失材質,當場景調入的時候就需要把存好的代理物體的原材質調出來給與它

⑩ 名詞解釋 指定代理

指定代理是按照人民法院或有關單位的指定發生代理權的代理。對擔任無民事行為能力人或限制民事行為能力人的監護人有爭議的,應當由未成年人的父、母所在單位或精神病人所在單位在近親屬中指定。有關單位指定監護人,以書面或口頭通知被指定人的,應當認定指定成立。指定代理是法律研究的重要對象

熱點內容
美發店認證 發布:2021-03-16 21:43:38 瀏覽:443
物業糾紛原因 發布:2021-03-16 21:42:46 瀏覽:474
全國著名不孕不育醫院 發布:2021-03-16 21:42:24 瀏覽:679
知名明星確診 發布:2021-03-16 21:42:04 瀏覽:14
ipad大專有用嗎 發布:2021-03-16 21:40:58 瀏覽:670
公務員協議班值得嗎 發布:2021-03-16 21:40:00 瀏覽:21
知名書店品牌 發布:2021-03-16 21:39:09 瀏覽:949
q雷授權碼在哪裡買 發布:2021-03-16 21:38:44 瀏覽:852
圖書天貓轉讓 發布:2021-03-16 21:38:26 瀏覽:707
寶寶水杯品牌 發布:2021-03-16 21:35:56 瀏覽:837