日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > C# >内容正文

C#

C# 之 HttpResponse 类

發(fā)布時(shí)間:2023/12/10 C# 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 C# 之 HttpResponse 类 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

????? Response 對(duì)象,派生自HttpResponse 類,該類封裝來自 ASP.NET 操作的 HTTP 響應(yīng)信息。存在于System.Web命名空間下。

????? 注:MIME(Multipurpose Internet Mail Extensions)多用途互聯(lián)網(wǎng)郵件擴(kuò)展類型就是設(shè)定某種擴(kuò)展名的文件用一種應(yīng)用程序來打開的方式類型,當(dāng)該擴(kuò)展名文件被訪問的時(shí)候,瀏覽器會(huì)自動(dòng)使用指定應(yīng)用程序來打開。多用于指定一些客戶端自定義的文件名,以及一些媒體文件打開方式。?

????? (一)構(gòu)造函數(shù):public HttpResponse(TextWriter writer)
????? (二)屬性:

名稱用法說明
BufferResponse.Buffer? = true

獲取或設(shè)置一個(gè)值,該值指示是否緩沖輸出并在處理完整個(gè)響應(yīng)之后發(fā)送它。

(true or false)

BufferOutputResponse.BufferOutput = true;

獲取或設(shè)置一個(gè)值,該值指示是否緩沖輸出并在處理完整個(gè)頁(yè)之后發(fā)送它。

(true or false)

Cache?Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetValidUntilExpires(false);
Response.Cache.VaryByParams["Category"] = true;

if (Response.Cache.VaryByParams["Category"])
{
?? //...
}
獲取網(wǎng)頁(yè)的緩存策略(例如:過期時(shí)間、保密性設(shè)置和變化條款)。
CacheControl?獲取或設(shè)置與 HttpCacheability枚舉值之一匹配的 Cache-Control HTTP 標(biāo)頭。
CharsetResponse.Charset == "iso-8859-2"獲取或設(shè)置輸出流的 HTTP 字符集。
ClientDisconnectedToken?獲取客戶端斷開時(shí)去除的 CancellationToken對(duì)象。
ContentEncodingResponse.ContentEncoding.EncodingName獲取或設(shè)置輸出流的 HTTP 字符集。
ContentType

Response.ContentType = "image/jpeg";? 等同于

Response.AddHeader("content-type", "image/jpeg");

獲取或設(shè)置輸出流的 HTTP MIME 類型,來區(qū)分不同種類的數(shù)據(jù)。
CookiesHttpCookie MyCookie = new HttpCookie("LastVisit");
DateTime now = DateTime.Now;
MyCookie.Value = now.ToString();
MyCookie.Expires = now.AddHours(1);
Response.Cookies.Add(MyCookie);
獲取響應(yīng) Cookie 集合。
Expires?

獲取或設(shè)置在瀏覽器上緩存的頁(yè)過期之前的分鐘數(shù)。如果用戶在頁(yè)面過期之前返回到該頁(yè),則顯示緩存的版本。提供 Expires是為了與 ASP 的早期版本兼容。

ExpiresAbsolute?

獲取或設(shè)置從緩存中移除緩存信息的絕對(duì)日期和時(shí)間。

提供 ExpiresAbsolute是為了與 ASP 的早期版本兼容。

Filter?Response.Filter = new UpperCaseFilterStream(Response.Filter);獲取或設(shè)置一個(gè)包裝篩選器對(duì)象,該對(duì)象用于在傳輸之前修改 HTTP 實(shí)體主體。
HeaderEncoding?獲取或設(shè)置一個(gè) Encoding象,該對(duì)象表示當(dāng)前標(biāo)頭輸出流的編碼。
Headers?獲取響應(yīng)標(biāo)頭的集合。
IsClientConnected?Response.IsClientConnected獲取一個(gè)值,通過該值指示客戶端是否仍連接在服務(wù)器上。(true or false)
IsRequestBeingRedirected?獲取一個(gè)布爾值,該值指示客戶端是否正在被傳輸?shù)叫碌奈恢谩?/span>
Output?if (IsPostBack)
{
?????Server.HtmlEncode(txtSubmitString.Text, Response.Output);
}
啟用到輸出 HTTP 響應(yīng)流的文本輸出。
OutputStream?bmp.Save(Response.OutputStream, ImageFormat.Jpeg);啟用到輸出 HTTP 內(nèi)容主體的二進(jìn)制輸出。
RedirectLocation?Response.RedirectLocation = "http://www.newurl.com ";獲取或設(shè)置 Http Location 標(biāo)頭的值。
Status?設(shè)置返回到客戶端的 Status 欄。
StatusCode?Response.StatusCode != 200獲取或設(shè)置返回給客戶端的輸出的 HTTP 狀態(tài)代碼。
StatusDescription?Response.StatusDescription != "OK"獲取或設(shè)置返回給客戶端的輸出的 HTTP 狀態(tài)字符串。
SubStatusCode?context.Response.SubStatusCode = 99;獲取或設(shè)置一個(gè)限定響應(yīng)的狀態(tài)代碼的值。
SupportsAsyncFlush?獲取一個(gè)值,該值指示集合是否支持異步刷新操作。
SuppressContent?Response.SuppressContent = true;獲取或設(shè)置一個(gè)值,該值指示是否將 HTTP 內(nèi)容發(fā)送到客戶端。
SuppressFormsAuthenticationRedirect?獲取或設(shè)置指定重定向至登錄頁(yè)的 forms 身份驗(yàn)證是否應(yīng)取消的值。
TrySkipIisCustomErrors?獲取或設(shè)置一個(gè)值,該值指定是否禁用 IIS 7.0 自定義錯(cuò)誤。(true or false)

????? (三)方法:???

名稱用法說明
AddCacheDependency(params CacheDependency[] dependencies)CacheDependency authorsDependency = new CacheDependency("authors.xml");??????
Response.AddCacheDependency(authorsDependency);
將一組緩存依賴項(xiàng)與響應(yīng)關(guān)聯(lián),這樣,如果響應(yīng)存儲(chǔ)在輸出緩存中并且指定的依賴項(xiàng)發(fā)生變化,就可以使該響應(yīng)失效。
AddCacheItemDependencies(ArrayList cacheKeys)ArrayList deps = new ArrayList();
deps.Add("bookData");
deps.Add("authorData");????
Response.AddCacheItemDependencies(deps);
使緩存響應(yīng)的有效性依賴于緩存中的其他項(xiàng)。
AddCacheItemDependencies(string[] cacheKeys)?使緩存項(xiàng)的有效性依賴于緩存中的另一項(xiàng)。
AddCacheItemDependency(string cacheKey)

?Response.AddCacheItemDependency("bookData");

使緩存響應(yīng)的有效性依賴于緩存中的其他項(xiàng)。
AddFileDependencies(ArrayList filenames)

ArrayList fileList = new ArrayList(); fileList.Add(file1); fileList.Add(file2);

Response.AddFileDependencies(fileList);

將一組文件名添加到文件名集合中,當(dāng)前響應(yīng)依賴于該集合。
AddFileDependencies(string[] filenames)String[] FileNames = new String[3];
FileNames[0] = "Test.txt";
FileNames[1] = "Test2.txt";
FileNames[2] = "Test3.txt";
Response.AddFileDependencies(FileNames);
將一個(gè)文件名數(shù)組添加到當(dāng)前響應(yīng)依賴的文件名集合中。
AddFileDependency(string filename)String FileName = "C:\\Files\\F1.txt";
Response.AddFileDependency(FileName);
將單個(gè)文件名添加到文件名集合中,當(dāng)前響應(yīng)依賴于該集合。
AddHeader(string name,string value)

Response.AddHeader("Content-Type","image/jpeg");? 等同于

Response.ContentType = "image/jpeg";

將 HTTP 頭添加到輸出流。提供 AddHeader 是為了與 ASP 的早期版本兼容。
AppendCookie(HttpCookie cookie)HttpCookie MyCookie = new HttpCookie("LastVisit");
MyCookie.Value = DateTime.Now.ToString();
Response.AppendCookie(MyCookie);
基礎(chǔ)結(jié)構(gòu)。將一個(gè) HTTP Cookie 添加到內(nèi)部 Cookie 集合。
AppendHeader(string name, string value ) Response.AppendHeader("CustomAspNetHeader", "Value1");將 HTTP 頭添加到輸出流。
AppendToLog(stringparam)Response.AppendToLog("Page delivered");將自定義日志信息添加到 Internet 信息服務(wù) (IIS) 日志文件。
ApplyAppPathModifier(string virtualPath)string urlConverted = Response.ApplyAppPathModifier("TestPage.aspx");如果會(huì)話使用 Cookieless 會(huì)話狀態(tài),則將該會(huì)話 ID 添加到虛擬路徑中,并返回組合路徑。如果不使用 Cookieless 會(huì)話狀態(tài),則 ApplyAppPathModifier 返回原始的虛擬路徑。
BeginFlush(AsyncCallback callback,
Object state)
public IAsyncResult BeginFlush(AsyncCallback callback,
Object state)
向客戶端發(fā)送當(dāng)前所有緩沖的響應(yīng)。
BinaryWrite(byte[] buffer)byte[] Buffer = new byte[(int)FileSize];
MyFileStream.Read(Buffer, 0, (int)FileSize);
MyFileStream.Close();
Response.Write("<b>File Contents: </b>");
Response.BinaryWrite(Buffer);
將一個(gè)二進(jìn)制字符串寫入 HTTP 輸出流。
Clear()Response.Clear();清除緩沖區(qū)流中的所有內(nèi)容輸出。
ClearContent()Response.ClearContent();清除緩沖區(qū)流中的所有內(nèi)容輸出。
ClearHeaders()Response.ClearHeaders();清除緩沖區(qū)流中的所有頭。
Close()Response.Close();關(guān)閉到客戶端的套接字連接。
DisableKernelCache()public void DisableKernelCache()禁用當(dāng)前響應(yīng)的內(nèi)核緩存。
DisableUserCache()public void DisableUserCache()禁用 IIS 用戶-方式來緩存反映。
End()Response.End();將當(dāng)前所有緩沖的輸出發(fā)送到客戶端,停止該頁(yè)的執(zhí)行,并引發(fā) EndRequest 事件。
EndFlushpublic void EndFlush(IAsyncResult asyncResult)完成異步刷新操作。
Equals(Object obj)Console.WriteLine("person1a and person1b: {0}", ((object) person1a).Equals((object) person1b));
Console.WriteLine("person1a and person2: {0}", ((object) person1a).Equals((object) person2));
確定指定的對(duì)象是否等于當(dāng)前對(duì)象。 (繼承自 Object。)
Flush()Response.Flush();向客戶端發(fā)送當(dāng)前所有緩沖的輸出。
GetHashCode()public virtual int GetHashCode()作為默認(rèn)哈希函數(shù)。 (繼承自 Object。)
GetType()Console.WriteLine("n1 and n2 are the same type: {0}",
Object.ReferenceEquals(n1.GetType(), n2.GetType()));
獲取當(dāng)前實(shí)例的 Type。 (繼承自 Object。)
Pics(string value )Response.Pics(?
"(pics-1.1 <http://www.icra.org/ratingsv02.html> " + "comment <ICRAonline EN v2.0> " +?
"l r (nz 1 vz 1 lz 1 oz 1 cz 1) " + "<http://www.rsac.org/ratingsv01.html> " +
" l r (n 0 s 0 v 0 l 0))");
將一個(gè) HTTP PICS-Label 標(biāo)頭追加到輸出流。
Redirect(string url)Response.Redirect("http://www.microsoft.com/gohere/look.htm");將請(qǐng)求重定向到新 URL 并指定該新 URL。
Redirect(string url, bool endResponse)Response.Redirect("default.aspx", false);將客戶端重定向到新的 URL。指定新的 URL 并指定當(dāng)前頁(yè)的執(zhí)行是否應(yīng)終止。
RedirectPermanent(string url)public void RedirectPermanent(string url)執(zhí)行從所請(qǐng)求 URL 到所指定 URL 的永久重定向。
RedirectPermanent(string url, bool endResponse)public void RedirectPermanent(string url,bool endResponse)執(zhí)行從所請(qǐng)求 URL 到所指定 URL 的永久重定向,并提供用于完成響應(yīng)的選項(xiàng)。
RedirectToRoute(Object routeValues)Response.RedirectToRoute(new { productid = "1", category = "widgets" });使用路由參數(shù)值將請(qǐng)求重定向到新 URL。
RedirectToRoute(RouteValueDictionary routeValues)Response.RedirectToRoute((new RouteValueDictionary {productId="1", category="widgets"});使用路由參數(shù)值將請(qǐng)求重定向到新 URL。
RedirectToRoute(string routeName)Response.RedirectToRoute("Products");使用路由名稱將請(qǐng)求重定向到新 URL。
RedirectToRoute(string routeName, Object routeValues)Response.RedirectToRoute("Product",new { productid = "1", category = "widgets" });使用路由參數(shù)值和路由名稱將請(qǐng)求重定向到新 URL。
RedirectToRoute(string routeName, RouteValueDictionary routeValues)Response.RedirectToRoute("Product",(new RouteValueDictionary {productId="1", category="widgets"}));使用路由參數(shù)值和路由名稱將請(qǐng)求重定向到新 URL。
RedirectToRoutePermanent(Object routeValues)Response.RedirectToRoutePermanent(new { productid = "1", category = "widgets" });使用路由參數(shù)值執(zhí)行從所請(qǐng)求 URL 到新 URL 的永久重定向。
RedirectToRoutePermanent(RouteValueDictionary routeValues)Response.RedirectToRoutePermanent(new RouteValueDictionary {productId="1", category="widgets"});使用路由參數(shù)值執(zhí)行從所請(qǐng)求 URL 到新 URL 的永久重定向。
RedirectToRoutePermanent(string routeName) Response.RedirectToRoutePermanent("Products");使用路由名稱執(zhí)行從所請(qǐng)求 URL 到新 URL 的永久重定向。
RedirectToRoutePermanent(string routeName, Object routeValues)Response.RedirectToRoutePermanent("Product",
new { productid = "1", category = "widgets" });
使用路由參數(shù)值以及與新 URL 對(duì)應(yīng)的路由的名稱執(zhí)行從所請(qǐng)求 URL 到新 URL 的永久重定向。
RedirectToRoutePermanent(string routeName, RouteValueDictionary routeValues) Response.RedirectToRoutePermanent("Product",new RouteValueDictionary {productId="1", category="widgets"});使用路由參數(shù)值和路由名稱執(zhí)行從所請(qǐng)求 URL 到新 URL 的永久重定向。
RemoveOutputCacheItem(string path)public static void RemoveOutputCacheItem(string path)從緩存中移除與默認(rèn)輸出緩存提供程序關(guān)聯(lián)的所有緩存項(xiàng)。此方法是靜態(tài)的。
RemoveOutputCacheItem(string path,
string providerName
)
public static void RemoveOutputCacheItem(string path,string providerName)使用指定的輸出緩存提供程序移除與指定路徑關(guān)聯(lián)的所有輸出緩存項(xiàng)。
SetCookie(HttpCookie cookie)MyCookie.Value = DateTime.Now.ToString();
Response.Cookies.Add(MyCookie);
基礎(chǔ)結(jié)構(gòu)。更新 Cookie 集合中的一個(gè)現(xiàn)有 Cookie。
ToString()public virtual string ToString()返回表示當(dāng)前對(duì)象的字符串。 (繼承自 Object。)
TransmitFile(string filename)public void TransmitFile(string filename)將指定的文件直接寫入 HTTP 響應(yīng)輸出流,而不在內(nèi)存中緩沖該文件。
TransmitFile(string, Int64, Int64)public void TransmitFile(string filename,long offset,long length)將文件的指定部分直接寫入 HTTP 響應(yīng)輸出流,而不在內(nèi)存中緩沖它。
Write(Char ch)char[] charArray = {'H', 'e', 'l', 'l', 'o', ',', ' ',?'w', 'o', 'r', 'l', 'd'};
Response.Write(';');
將一個(gè)字符寫入 HTTP 響應(yīng)輸出流。
Write(Object obj) object obj = (object)13;
Response.Write(obj);
Object 寫入 HTTP 響應(yīng)流。
Write(string str)Response.Write("Hello " + Server.HtmlEncode(Request.QueryString["UserName"]) + "<br>");將一個(gè)字符串寫入 HTTP 響應(yīng)輸出流。
Write(char[] buffer,int index,int count)Response.Write(charArray, 0, charArray.Length);將一個(gè)字符數(shù)組寫入 HTTP 響應(yīng)輸出流。
WriteFile(string fileName)Response.Write("Please Login: <br>");
Response.WriteFile("login.txt");
將指定文件的內(nèi)容作為文件塊直接寫入 HTTP 響應(yīng)輸出流。
WriteFile(string filename, bool readIntoMemory)Response.WriteFile("login.txt", true);將指定文件的內(nèi)容作為內(nèi)存塊直接寫入 HTTP 響應(yīng)輸出流。
WriteFile(IntPtr fileHandle, long offset,
long size
)
String FileName;
FileStream MyFileStream;
IntPtr FileHandle;
long StartPos = 0, FileSize;

FileName = "c:\\temp\\Login.txt";

MyFileStream = new FileStream(FileName, FileMode.Open);
FileHandle = MyFileStream.Handle;
FileSize = MyFileStream.Length;

Response.Write("<b>Login: </b>");
Response.Write("<input type=text id=user /> ");
Response.Write("<input type=submit value=Submit /><br><br>");

Response.WriteFile(FileHandle, StartPos, FileSize);

MyFileStream.Close();
將指定的文件直接寫入 HTTP 響應(yīng)輸出流。
WriteFile(string fileName, Int64 offSet, Int64 size)String FileName;
FileInfo MyFileInfo;
long StartPos = 0, FileSize;

FileName = "c:\\temp\\login.txt";
MyFileInfo = new FileInfo(FileName);
FileSize = MyFileInfo.Length;

Response.Write("Please Login: <br>");
Response.WriteFile(FileName, StartPos, FileSize);
將指定的文件直接寫入 HTTP 響應(yīng)輸出流。
WriteSubstitution(HttpResponseSubstitutionCallback callback)public void WriteSubstitution(HttpResponseSubstitutionCallback callback)允許將響應(yīng)替換塊插入響應(yīng),從而允許為緩存的輸出響應(yīng)動(dòng)態(tài)生成指定的響應(yīng)區(qū)域。

注意:HttpResponse 類的方法和屬性通過 HttpApplication、HttpContext、Page和 UserControl類的 Response屬性公開。

僅在回發(fā)情況(不包括異步回發(fā)情況)下才支持 HttpResponse 類的以下方法:Binary,WriteClear,ClearContent,ClearHeaders,Close,End,Flush,TransmitFile,Write,WriteFile,WriteSubstitution.

<%@ Page Language="C#" %> <%@ import Namespace="System.Drawing" %> <%@ import Namespace="System.Drawing.Imaging" %> <%@ import Namespace="System.Drawing.Drawing2D" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server">private void Page_Load(object sender, EventArgs e){// 設(shè)置頁(yè)面的ContentType為JPEG 文件// Response.ContentType = "image/jpeg";Response.Clear();// Buffer response so that page is sent// after processing is complete.Response.BufferOutput = true;// Create a font style.Font rectangleFont = new Font("Arial", 10, FontStyle.Bold);// Create integer variables.int height = 100;int width = 200;// Create a random number generator and create// variable values based on it.Random r = new Random();int x = r.Next(75);int a = r.Next(155);int x1 = r.Next(100);// Create a bitmap and use it to create a// Graphics object.Bitmap bmp = new Bitmap(width, height, PixelFormat.Format24bppRgb);Graphics g = Graphics.FromImage(bmp);g.SmoothingMode = SmoothingMode.AntiAlias;g.Clear(Color.LightGray);// Use the Graphics object to draw three rectangles.g.DrawRectangle(Pens.White, 1, 1, width-3, height-3);g.DrawRectangle(Pens.Aquamarine, 2, 2, width-3, height-3);g.DrawRectangle(Pens.Black, 0, 0, width, height);// Use the Graphics object to write a string// on the rectangles. g.DrawString("ASP.NET Samples", rectangleFont,SystemBrushes.WindowText, new PointF(10, 40));// Apply color to two of the rectangles. g.FillRectangle(new SolidBrush(Color.FromArgb(a, 255, 128, 255)),x, 20, 100, 50);g.FillRectangle(new LinearGradientBrush(new Point(x, 10),new Point(x1 + 75, 50 + 30),Color.FromArgb(128, 0, 0, 128),Color.FromArgb(255, 255, 255, 240)),x1, 50, 75, 30);// Save the bitmap to the response stream and// convert it to JPEG format. bmp.Save(Response.OutputStream, ImageFormat.Jpeg);// Release memory used by the Graphics object// and the bitmap. g.Dispose();bmp.Dispose();// Send the output to the client. Response.Flush();}</script> <html xmlns="http://www.w3.org/1999/xhtml" > <head><title>ASP.NET Example</title> </head> <body><form id="form1" runat="server"></form> </body> </html> View Code

?

附:Response的ContentType類型對(duì)照表

類型列表如下:?

文件擴(kuò)展名Content-Type(Mime-Type)文件擴(kuò)展名Content-Type(Mime-Type)
.*( 二進(jìn)制流,不知道下載文件類型)application/octet-stream.tifimage/tiff
.001application/x-001.301application/x-301
.323text/h323.906application/x-906
.907drawing/907.a11application/x-a11
.acpaudio/x-mei-aac.aiapplication/postscript
.aifaudio/aiff.aifcaudio/aiff
.aiffaudio/aiff.anvapplication/x-anv
.asatext/asa.asfvideo/x-ms-asf
.asptext/asp.asxvideo/x-ms-asf
.auaudio/basic.avivideo/avi
.awfapplication/vnd.adobe.workflow.biztext/xml
.bmpapplication/x-bmp.botapplication/x-bot
.c4tapplication/x-c4t.c90application/x-c90
.calapplication/x-cals.catapplication/vnd.ms-pki.seccat
.cdfapplication/x-netcdf.cdrapplication/x-cdr
.celapplication/x-cel.cerapplication/x-x509-ca-cert
.cg4application/x-g4.cgmapplication/x-cgm
.citapplication/x-cit.classjava/*
.cmltext/xml.cmpapplication/x-cmp
.cmxapplication/x-cmx.cotapplication/x-cot
.crlapplication/pkix-crl.crtapplication/x-x509-ca-cert
.csiapplication/x-csi.csstext/css
.cutapplication/x-cut.dbfapplication/x-dbf
.dbmapplication/x-dbm.dbxapplication/x-dbx
.dcdtext/xml.dcxapplication/x-dcx
.derapplication/x-x509-ca-cert.dgnapplication/x-dgn
.dibapplication/x-dib.dllapplication/x-msdownload
.docapplication/msword.dotapplication/msword
.drwapplication/x-drw.dtdtext/xml
.dwfModel/vnd.dwf.dwfapplication/x-dwf
.dwgapplication/x-dwg.dxbapplication/x-dxb
.dxfapplication/x-dxf.ednapplication/vnd.adobe.edn
.emfapplication/x-emf.emlmessage/rfc822
.enttext/xml.epiapplication/x-epi
.epsapplication/x-ps.epsapplication/postscript
.etdapplication/x-ebx.exeapplication/x-msdownload
.faximage/fax.fdfapplication/vnd.fdf
.fifapplication/fractals.fotext/xml
.frmapplication/x-frm.g4application/x-g4
.gbrapplication/x-gbr.application/x-
.gifimage/gif.gl2application/x-gl2
.gp4application/x-gp4.hglapplication/x-hgl
.hmrapplication/x-hmr.hpgapplication/x-hpgl
.hplapplication/x-hpl.hqxapplication/mac-binhex40
.hrfapplication/x-hrf.htaapplication/hta
.htctext/x-component.htmtext/html
.htmltext/html.htttext/webviewhtml
.htxtext/html.icbapplication/x-icb
.icoimage/x-icon.icoapplication/x-ico
.iffapplication/x-iff.ig4application/x-g4
.igsapplication/x-igs.iiiapplication/x-iphone
.imgapplication/x-img.insapplication/x-internet-signup
.ispapplication/x-internet-signup.IVFvideo/x-ivf
.javajava/*.jfifimage/jpeg
.jpeimage/jpeg.jpeapplication/x-jpe
.jpegimage/jpeg.jpgimage/jpeg
.jpgapplication/x-jpg.jsapplication/x-javascript
.jsptext/html.la1audio/x-liquid-file
.larapplication/x-laplayer-reg.latexapplication/x-latex
.lavsaudio/x-liquid-secure.lbmapplication/x-lbm
.lmsffaudio/x-la-lms.lsapplication/x-javascript
.ltrapplication/x-ltr.m1vvideo/x-mpeg
.m2vvideo/x-mpeg.m3uaudio/mpegurl
.m4evideo/mpeg4.macapplication/x-mac
.manapplication/x-troff-man.mathtext/xml
.mdbapplication/msaccess.mdbapplication/x-mdb
.mfpapplication/x-shockwave-flash.mhtmessage/rfc822
.mhtmlmessage/rfc822.miapplication/x-mi
.midaudio/mid.midiaudio/mid
.milapplication/x-mil.mmltext/xml
.mndaudio/x-musicnet-download.mnsaudio/x-musicnet-stream
.mochaapplication/x-javascript.movievideo/x-sgi-movie
.mp1audio/mp1.mp2audio/mp2
.mp2vvideo/mpeg.mp3audio/mp3
.mp4video/mpeg4.mpavideo/x-mpg
.mpdapplication/vnd.ms-project.mpevideo/x-mpeg
.mpegvideo/mpg.mpgvideo/mpg
.mpgaaudio/rn-mpeg.mppapplication/vnd.ms-project
.mpsvideo/x-mpeg.mptapplication/vnd.ms-project
.mpvvideo/mpg.mpv2video/mpeg
.mpwapplication/vnd.ms-project.mpxapplication/vnd.ms-project
.mtxtext/xml.mxpapplication/x-mmxp
.netimage/pnetvue.nrfapplication/x-nrf
.nwsmessage/rfc822.odctext/x-ms-odc
.outapplication/x-out.p10application/pkcs10
.p12application/x-pkcs12.p7bapplication/x-pkcs7-certificates
.p7capplication/pkcs7-mime.p7mapplication/pkcs7-mime
.p7rapplication/x-pkcs7-certreqresp.p7sapplication/pkcs7-signature
.pc5application/x-pc5.pciapplication/x-pci
.pclapplication/x-pcl.pcxapplication/x-pcx
.pdfapplication/pdf.pdfapplication/pdf
.pdxapplication/vnd.adobe.pdx.pfxapplication/x-pkcs12
.pglapplication/x-pgl.picapplication/x-pic
.pkoapplication/vnd.ms-pki.pko.plapplication/x-perl
.plgtext/html.plsaudio/scpls
.pltapplication/x-plt.pngimage/png
.pngapplication/x-png.potapplication/vnd.ms-powerpoint
.ppaapplication/vnd.ms-powerpoint.ppmapplication/x-ppm
.ppsapplication/vnd.ms-powerpoint.pptapplication/vnd.ms-powerpoint
.pptapplication/x-ppt.prapplication/x-pr
.prfapplication/pics-rules.prnapplication/x-prn
.prtapplication/x-prt.psapplication/x-ps
.psapplication/postscript.ptnapplication/x-ptn
.pwzapplication/vnd.ms-powerpoint.r3ttext/vnd.rn-realtext3d
.raaudio/vnd.rn-realaudio.ramaudio/x-pn-realaudio
.rasapplication/x-ras.ratapplication/rat-file
.rdftext/xml.recapplication/vnd.rn-recording
.redapplication/x-red.rgbapplication/x-rgb
.rjsapplication/vnd.rn-realsystem-rjs.rjtapplication/vnd.rn-realsystem-rjt
.rlcapplication/x-rlc.rleapplication/x-rle
.rmapplication/vnd.rn-realmedia.rmfapplication/vnd.adobe.rmf
.rmiaudio/mid.rmjapplication/vnd.rn-realsystem-rmj
.rmmaudio/x-pn-realaudio.rmpapplication/vnd.rn-rn_music_package
.rmsapplication/vnd.rn-realmedia-secure.rmvbapplication/vnd.rn-realmedia-vbr
.rmxapplication/vnd.rn-realsystem-rmx.rnxapplication/vnd.rn-realplayer
.rpimage/vnd.rn-realpix.rpmaudio/x-pn-realaudio-plugin
.rsmlapplication/vnd.rn-rsml.rttext/vnd.rn-realtext
.rtfapplication/msword.rtfapplication/x-rtf
.rvvideo/vnd.rn-realvideo.samapplication/x-sam
.satapplication/x-sat.sdpapplication/sdp
.sdwapplication/x-sdw.sitapplication/x-stuffit
.slbapplication/x-slb.sldapplication/x-sld
.slkdrawing/x-slk.smiapplication/smil
.smilapplication/smil.smkapplication/x-smk
.sndaudio/basic.soltext/plain
.sortext/plain.spcapplication/x-pkcs7-certificates
.splapplication/futuresplash.spptext/xml
.ssmapplication/streamingmedia.sstapplication/vnd.ms-pki.certstore
.stlapplication/vnd.ms-pki.stl.stmtext/html
.styapplication/x-sty.svgtext/xml
.swfapplication/x-shockwave-flash.tdfapplication/x-tdf
.tg4application/x-tg4.tgaapplication/x-tga
.tifimage/tiff.tifapplication/x-tif
.tiffimage/tiff.tldtext/xml
.topdrawing/x-top.torrentapplication/x-bittorrent
.tsdtext/xml.txttext/plain
.uinapplication/x-icq.ulstext/iuls
.vcftext/x-vcard.vdaapplication/x-vda
.vdxapplication/vnd.visio.vmltext/xml
.vpgapplication/x-vpeg005.vsdapplication/vnd.visio
.vsdapplication/x-vsd.vssapplication/vnd.visio
.vstapplication/vnd.visio.vstapplication/x-vst
.vswapplication/vnd.visio.vsxapplication/vnd.visio
.vtxapplication/vnd.visio.vxmltext/xml
.wavaudio/wav.waxaudio/x-ms-wax
.wb1application/x-wb1.wb2application/x-wb2
.wb3application/x-wb3.wbmpimage/vnd.wap.wbmp
.wizapplication/msword.wk3application/x-wk3
.wk4application/x-wk4.wkqapplication/x-wkq
.wksapplication/x-wks.wmvideo/x-ms-wm
.wmaaudio/x-ms-wma.wmdapplication/x-ms-wmd
.wmfapplication/x-wmf.wmltext/vnd.wap.wml
.wmvvideo/x-ms-wmv.wmxvideo/x-ms-wmx
.wmzapplication/x-ms-wmz.wp6application/x-wp6
.wpdapplication/x-wpd.wpgapplication/x-wpg
.wplapplication/vnd.ms-wpl.wq1application/x-wq1
.wr1application/x-wr1.wriapplication/x-wri
.wrkapplication/x-wrk.wsapplication/x-ws
.ws2application/x-ws.wsctext/scriptlet
.wsdltext/xml.wvxvideo/x-ms-wvx
.xdpapplication/vnd.adobe.xdp.xdrtext/xml
.xfdapplication/vnd.adobe.xfd.xfdfapplication/vnd.adobe.xfdf
.xhtmltext/html.xlsapplication/vnd.ms-excel
.xlsapplication/x-xls.xlwapplication/x-xlw
.xmltext/xml.xplaudio/scpls
.xqtext/xml.xqltext/xml
.xquerytext/xml.xsdtext/xml
.xsltext/xml.xslttext/xml
.xwdapplication/x-xwd.x_bapplication/x-x_b
.sisapplication/vnd.symbian.install.sisxapplication/vnd.symbian.install
.x_tapplication/x-x_t.ipaapplication/vnd.iphone
.apkapplication/vnd.android.package-archive.xapapplication/x-silverlight-app
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)

總結(jié)

以上是生活随笔為你收集整理的C# 之 HttpResponse 类的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。