工作者对象HttpWorkerRequest

在ASP.NET中,用于处理的请求,需要封装为HttpWorkerRequest类型的对象。该类为抽象类,定义在命名空间System.Web下。

复制代码
#region Assembly System.Web.dll, v4.0.0.0
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.dll
#endregionusing System;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Text;
using System.Web.Management;namespace System.Web
{// Summary://     This abstract class defines the base worker methods and enumerations used//     by ASP.NET managed code to process requests.[ComVisible(false)]public abstract class HttpWorkerRequest{// Summary://     Specifies the index number for the Accept HTTP header.public const int HeaderAccept = 20;//// Summary://     Specifies the index number for the Accept-Charset HTTP header.public const int HeaderAcceptCharset = 21;//// Summary://     Specifies the index number for the Accept-Encoding HTTP header.public const int HeaderAcceptEncoding = 22;//// Summary://     Specifies the index number for the Accept-Language HTTP header.public const int HeaderAcceptLanguage = 23;//// Summary://     Specifies the index number for the Accept-Ranges HTTP header.public const int HeaderAcceptRanges = 20;//// Summary://     Specifies the index number for the Age HTTP header.public const int HeaderAge = 21;//// Summary://     Specifies the index number for the Allow HTTP header.public const int HeaderAllow = 10;//// Summary://     Specifies the index number for the Authorization HTTP header.public const int HeaderAuthorization = 24;//// Summary://     The index that represents the HTTP Cache-Control HTTP header.public const int HeaderCacheControl = 0;//// Summary://     Specifies the index number for the Connection HTTP header.public const int HeaderConnection = 1;//// Summary://     Specifies the index number for the Content-Encoding HTTP header.public const int HeaderContentEncoding = 13;//// Summary://     Specifies the index number for the Content-Language HTTP header.public const int HeaderContentLanguage = 14;//// Summary://     Specifies the index number for the Content-Length HTTP header.public const int HeaderContentLength = 11;//// Summary://     Specifies the index number for the Content-Location HTTP header.public const int HeaderContentLocation = 15;//// Summary://     Specifies the index number for the Content-MD5 HTTP header.public const int HeaderContentMd5 = 16;//// Summary://     Specifies the index number for the Content-Range HTTP header.public const int HeaderContentRange = 17;//// Summary://     Specifies the index number for the Content-Type HTTP header.public const int HeaderContentType = 12;//// Summary://     Specifies the index number for the Cookie HTTP header.public const int HeaderCookie = 25;//// Summary://     Specifies the index number for the Date HTTP header.public const int HeaderDate = 2;//// Summary://     Specifies the index number for the ETag HTTP header.public const int HeaderEtag = 22;//// Summary://     Specifies the index number for the Except HTTP header.public const int HeaderExpect = 26;//// Summary://     Specifies the index number for the Expires HTTP header.public const int HeaderExpires = 18;//// Summary://     Specifies the index number for the From HTTP header.public const int HeaderFrom = 27;//// Summary://     Specifies the index number for the Host HTTP header.public const int HeaderHost = 28;//// Summary://     Specifies the index number for the If-Match HTTP header.public const int HeaderIfMatch = 29;//// Summary://     Specifies the index number for the If-Modified-Since HTTP header.public const int HeaderIfModifiedSince = 30;//// Summary://     Specifies the index number for the If-None-Match HTTP header.public const int HeaderIfNoneMatch = 31;//// Summary://     Specifies the index number for the If-Range HTTP header.public const int HeaderIfRange = 32;//// Summary://     Specifies the index number for the If-Unmodified-Since HTTP header.public const int HeaderIfUnmodifiedSince = 33;//// Summary://     Specifies the index number for the Keep-Alive HTTP header.public const int HeaderKeepAlive = 3;//// Summary://     Specifies the index number for the Last-Modified HTTP header.public const int HeaderLastModified = 19;//// Summary://     Specifies the index number for the Location HTTP header.public const int HeaderLocation = 23;//// Summary://     Specifies the index number for the Max-Forwards HTTP header.public const int HeaderMaxForwards = 34;//// Summary://     Specifies the index number for the Pragma HTTP header.public const int HeaderPragma = 4;//// Summary://     Specifies the index number for the Proxy-Authenticate HTTP header.public const int HeaderProxyAuthenticate = 24;//// Summary://     Specifies the index number for the Proxy-Authorization HTTP header.public const int HeaderProxyAuthorization = 35;//// Summary://     Specifies the index number for the Range HTTP header.public const int HeaderRange = 37;//// Summary://     Specifies the index number for the Referer HTTP header.public const int HeaderReferer = 36;//// Summary://     Specifies the index number for the Retry-After HTTP header.public const int HeaderRetryAfter = 25;//// Summary://     Specifies the index number for the Server HTTP header.public const int HeaderServer = 26;//// Summary://     Specifies the index number for the Set-Cookie HTTP header.public const int HeaderSetCookie = 27;//// Summary://     Specifies the index number for the TE HTTP header.public const int HeaderTe = 38;//// Summary://     Specifies the index number for the Trailer HTTP header.public const int HeaderTrailer = 5;//// Summary://     Specifies the index number for the Transfer-Encoding HTTP header.public const int HeaderTransferEncoding = 6;//// Summary://     Specifies the index number for the Upgrade HTTP header.public const int HeaderUpgrade = 7;//// Summary://     Specifies the index number for the User-Agent HTTP header.public const int HeaderUserAgent = 39;//// Summary://     Specifies the index number for the Vary HTTP header.public const int HeaderVary = 28;//// Summary://     Specifies the index number for the Via HTTP header.public const int HeaderVia = 8;//// Summary://     Specifies the index number for the Warning HTTP header.public const int HeaderWarning = 9;//// Summary://     Specifies the index number for the WWW-Authenticate HTTP header.public const int HeaderWwwAuthenticate = 29;//// Summary://     Specifies a reason for the request.public const int ReasonCachePolicy = 2;//// Summary://     Specifies a reason for the request.public const int ReasonCacheSecurity = 3;//// Summary://     Specifies a reason for the request.public const int ReasonClientDisconnect = 4;//// Summary://     Specifies a reason for the request. The default value is System.Web.HttpWorkerRequest.ReasonResponseCacheMiss.public const int ReasonDefault = 0;//// Summary://     Specifies a reason for the request.public const int ReasonFileHandleCacheMiss = 1;//// Summary://     Specifies a reason for the request.public const int ReasonResponseCacheMiss = 0;//// Summary://     Specifies the index number for the Maximum HTTP request header.public const int RequestHeaderMaximum = 40;//// Summary://     Specifies the index number for the Maximum HTTP response header.public const int ResponseHeaderMaximum = 30;// Summary://     Initializes a new instance of the System.Web.HttpWorkerRequest class.protected HttpWorkerRequest();// Summary://     Gets the full physical path to the Machine.config file.//// Returns://     The physical path to the Machine.config file.public virtual string MachineConfigPath { get; }//// Summary://     Gets the physical path to the directory where the ASP.NET binaries are installed.//// Returns://     The physical directory to the ASP.NET binary files.public virtual string MachineInstallDirectory { get; }//// Summary://     Gets the corresponding Event Tracking for Windows trace ID for the current//     request.//// Returns://     A trace ID for the current ASP.NET request.public virtual Guid RequestTraceIdentifier { get; }//// Summary://     Gets the full physical path to the root Web.config file.//// Returns://     The physical path to the root Web.config file.public virtual string RootWebConfigPath { get; }//// Summary://     Gets a value that indicates whether asynchronous flush operations are supported.//// Returns://     true if asynchronous flush operations are supported; otherwise, false.public virtual bool SupportsAsyncFlush { get; }//// Summary://     Gets a value that indicates whether asynchronous read operations are supported.//// Returns://     true if asynchronous read operations are supported; otherwise, false.public virtual bool SupportsAsyncRead { get; }// Summary://     Sends the currently buffered response to the client.//// Parameters://   callback://     The method to call when a corresponding asynchronous operation completes.////   state://     A user-provided object that distinguishes this particular asynchronous flush//     operation from other requests.//// Returns://     The worker request buffers the status, headers, and response body until an//     asynchronous flush operation is initiated. If the underlying System.Web.HttpWorkerRequest//     object supports asynchronous flush and this method is called from an asynchronous//     module event or asynchronous handler, the send operation is performed asynchronously.//     Otherwise, the implementation performs a synchronous flush operation.public virtual IAsyncResult BeginFlush(AsyncCallback callback, object state);//// Summary://     Begins an asynchronous read operation of the request entity body.//// Parameters://   buffer://     The buffer to read the data into.////   offset://     The byte offset in the buffer at which to begin writing data.////   count://     The maximum number of bytes to read.////   callback://     The method to call when a corresponding asynchronous operation completes.////   state://     A user-provided object that distinguishes this particular asynchronous read//     from other requests.public virtual IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state);//// Summary://     Terminates the connection with the client.public virtual void CloseConnection();//// Summary://     Waits for the pending asynchronous flush operation to complete.//// Parameters://   asyncResult://     A reference to the pending asynchronous request.public virtual void EndFlush(IAsyncResult asyncResult);//// Summary://     Used by the runtime to notify the System.Web.HttpWorkerRequest that request//     processing for the current request is complete.public abstract void EndOfRequest();//// Summary://     Waits for the pending asynchronous read operation to complete.//// Parameters://   asyncResult://     A reference to the pending asynchronous request.//// Returns://     The number of bytes that have been read from the stream.public virtual int EndRead(IAsyncResult asyncResult);//// Summary://     Sends all pending response data to the client.//// Parameters://   finalFlush://     true if this is the last time response data will be flushed; otherwise, false.public abstract void FlushResponse(bool finalFlush);//// Summary://     Returns the virtual path to the currently executing server application.//// Returns://     The virtual path of the current application.public virtual string GetAppPath();//// Summary://     Returns the physical path to the currently executing server application.//// Returns://     The physical path of the current application.public virtual string GetAppPathTranslated();//// Summary://     When overridden in a derived class, returns the application pool ID for the//     current URL.//// Returns://     Always returns null.public virtual string GetAppPoolID();//// Summary://     Gets the number of bytes read in from the client.//// Returns://     A Long containing the number of bytes read.public virtual long GetBytesRead();//// Summary://     When overridden in a derived class, gets the certification fields (specified//     in the X.509 standard) from a request issued by the client.//// Returns://     A byte array containing the stream of the entire certificate content.public virtual byte[] GetClientCertificate();//// Summary://     Gets the certificate issuer, in binary format.//// Returns://     A byte array containing the certificate issuer expressed in binary format.public virtual byte[] GetClientCertificateBinaryIssuer();//// Summary://     When overridden in a derived class, returns the System.Text.Encoding object//     in which the client certificate was encoded.//// Returns://     The certificate encoding, expressed as an integer.public virtual int GetClientCertificateEncoding();//// Summary://     When overridden in a derived class, gets a PublicKey object associated with//     the client certificate.//// Returns://     A PublicKey object.public virtual byte[] GetClientCertificatePublicKey();//// Summary://     When overridden in a derived class, gets the date when the certificate becomes//     valid. The date varies with international settings.//// Returns://     A System.DateTime object representing when the certificate becomes valid.public virtual DateTime GetClientCertificateValidFrom();//// Summary://     Gets the certificate expiration date.//// Returns://     A System.DateTime object representing the date that the certificate expires.public virtual DateTime GetClientCertificateValidUntil();//// Summary://     When overridden in a derived class, returns the ID of the current connection.//// Returns://     Always returns 0.public virtual long GetConnectionID();//// Summary://     When overridden in a derived class, returns the virtual path to the requested//     URI.//// Returns://     The path to the requested URI.public virtual string GetFilePath();//// Summary://     Returns the physical file path to the requested URI (and translates it from//     virtual path to physical path: for example, "/proj1/page.aspx" to "c:\dir\page.aspx")//// Returns://     The translated physical file path to the requested URI.public virtual string GetFilePathTranslated();//// Summary://     Returns the specified member of the request header.//// Returns://     The HTTP verb returned in the request header.public abstract string GetHttpVerbName();//// Summary://     Provides access to the HTTP version of the request (for example, "HTTP/1.1").//// Returns://     The HTTP version returned in the request header.public abstract string GetHttpVersion();//// Summary://     Returns the standard HTTP request header that corresponds to the specified//     index.//// Parameters://   index://     The index of the header. For example, the System.Web.HttpWorkerRequest.HeaderAllow//     field.//// Returns://     The HTTP request header.public virtual string GetKnownRequestHeader(int index);//// Summary://     Returns the index number of the specified HTTP request header.//// Parameters://   header://     The name of the header.//// Returns://     The index number of the HTTP request header specified in the header parameter.public static int GetKnownRequestHeaderIndex(string header);//// Summary://     Returns the name of the specified HTTP request header.//// Parameters://   index://     The index number of the header.//// Returns://     The name of the HTTP request header specified in the index parameter.public static string GetKnownRequestHeaderName(int index);//// Summary://     Returns the index number of the specified HTTP response header.//// Parameters://   header://     The name of the HTTP header.//// Returns://     The index number of the HTTP response header specified in the header parameter.public static int GetKnownResponseHeaderIndex(string header);//// Summary://     Returns the name of the specified HTTP response header.//// Parameters://   index://     The index number of the header.//// Returns://     The name of the HTTP response header specified in the index parameter.public static string GetKnownResponseHeaderName(int index);//// Summary://     Provides access to the specified member of the request header.//// Returns://     The server IP address returned in the request header.public abstract string GetLocalAddress();//// Summary://     Provides access to the specified member of the request header.//// Returns://     The server port number returned in the request header.public abstract int GetLocalPort();//// Summary://     Returns additional path information for a resource with a URL extension.//     That is, for the path /virdir/page.html/tail, the GetPathInfo value is /tail.//// Returns://     Additional path information for a resource.public virtual string GetPathInfo();//// Summary://     Returns the portion of the HTTP request body that has already been read.//// Returns://     The portion of the HTTP request body that has been read.public virtual byte[] GetPreloadedEntityBody();//// Summary://     Gets the portion of the HTTP request body that has currently been read by//     using the specified buffer data and byte offset.//// Parameters://   buffer://     The data to read.////   offset://     The byte offset at which to begin reading.//// Returns://     The portion of the HTTP request body that has been read.public virtual int GetPreloadedEntityBody(byte[] buffer, int offset);//// Summary://     Gets the length of the portion of the HTTP request body that has currently//     been read.//// Returns://     An integer containing the length of the currently read HTTP request body.public virtual int GetPreloadedEntityBodyLength();//// Summary://     When overridden in a derived class, returns the HTTP protocol (HTTP or HTTPS).//// Returns://     HTTPS if the System.Web.HttpWorkerRequest.IsSecure() method is true, otherwise//     HTTP.public virtual string GetProtocol();//// Summary://     Returns the query string specified in the request URL.//// Returns://     The request query string.public abstract string GetQueryString();//// Summary://     When overridden in a derived class, returns the response query string as//     an array of bytes.//// Returns://     An array of bytes containing the response.public virtual byte[] GetQueryStringRawBytes();//// Summary://     Returns the URL path contained in the request header with the query string//     appended.//// Returns://     The raw URL path of the request header.public abstract string GetRawUrl();//// Summary://     Provides access to the specified member of the request header.//// Returns://     The client's IP address.public abstract string GetRemoteAddress();//// Summary://     When overridden in a derived class, returns the name of the client computer.//// Returns://     The name of the client computer.public virtual string GetRemoteName();//// Summary://     Provides access to the specified member of the request header.//// Returns://     The client's HTTP port number.public abstract int GetRemotePort();//// Summary://     When overridden in a derived class, returns the reason for the request.//// Returns://     Reason code. The default is ReasonResponseCacheMiss.public virtual int GetRequestReason();//// Summary://     When overridden in a derived class, returns the name of the local server.//// Returns://     The name of the local server.public virtual string GetServerName();//// Summary://     Returns a single server variable from a dictionary of server variables associated//     with the request.//// Parameters://   name://     The name of the requested server variable.//// Returns://     The requested server variable.public virtual string GetServerVariable(string name);//// Summary://     Returns a string that describes the name of the specified HTTP status code.//// Parameters://   code://     The HTTP status code.//// Returns://     The status description. For example, System.Web.HttpWorkerRequest.GetStatusDescription(System.Int32)//     (404) returns "Not Found".public static string GetStatusDescription(int code);//// Summary://     Gets the length of the entire HTTP request body.//// Returns://     An integer containing the length of the entire HTTP request body.public virtual int GetTotalEntityBodyLength();//// Summary://     Returns a nonstandard HTTP request header value.//// Parameters://   name://     The header name.//// Returns://     The header value.public virtual string GetUnknownRequestHeader(string name);//// Summary://     Get all nonstandard HTTP header name-value pairs.//// Returns://     An array of header name-value pairs.[CLSCompliant(false)]public virtual string[][] GetUnknownRequestHeaders();//// Summary://     Returns the virtual path to the requested URI.//// Returns://     The path to the requested URI.public abstract string GetUriPath();//// Summary://     When overridden in a derived class, returns the context ID of the current//     connection.//// Returns://     Always returns 0.public virtual long GetUrlContextID();//// Summary://     When overridden in a derived class, returns the client's impersonation token.//// Returns://     A value representing the client's impersonation token. The default is 0.public virtual IntPtr GetUserToken();//// Summary://     Gets the impersonation token for the request virtual path.//// Returns://     An unmanaged memory pointer for the token for the request virtual path.public virtual IntPtr GetVirtualPathToken();//// Summary://     Returns a value indicating whether the request contains body data.//// Returns://     true if the request contains body data; otherwise, false.public bool HasEntityBody();//// Summary://     Returns a value indicating whether HTTP response headers have been sent to//     the client for the current request.//// Returns://     true if HTTP response headers have been sent to the client; otherwise, false.public virtual bool HeadersSent();//// Summary://     Returns a value indicating whether the client connection is still active.//// Returns://     true if the client connection is still active; otherwise, false.public virtual bool IsClientConnected();//// Summary://     Returns a value indicating whether all request data is available and no further//     reads from the client are required.//// Returns://     true if all request data is available; otherwise, false.public virtual bool IsEntireEntityBodyIsPreloaded();//// Summary://     Returns a value indicating whether the connection uses SSL.//// Returns://     true if the connection is an SSL connection; otherwise, false. The default//     is false.public virtual bool IsSecure();//// Summary://     Returns the physical path corresponding to the specified virtual path.//// Parameters://   virtualPath://     The virtual path.//// Returns://     The physical path that corresponds to the virtual path specified in the virtualPath//     parameter.public virtual string MapPath(string virtualPath);//// Summary://     Reads request data from the client (when not preloaded).//// Parameters://   buffer://     The byte array to read data into.////   size://     The maximum number of bytes to read.//// Returns://     The number of bytes read.public virtual int ReadEntityBody(byte[] buffer, int size);//// Summary://     Reads request data from the client (when not preloaded) by using the specified//     buffer to read from, byte offset, and maximum bytes.//// Parameters://   buffer://     The byte array to read data into.////   offset://     The byte offset at which to begin reading.////   size://     The maximum number of bytes to read.//// Returns://     The number of bytes read.public virtual int ReadEntityBody(byte[] buffer, int offset, int size);//// Summary://     Adds a Content-Length HTTP header to the response for message bodies that//     are less than or equal to 2 GB.//// Parameters://   contentLength://     The length of the response, in bytes.public virtual void SendCalculatedContentLength(int contentLength);//// Summary://     Adds a Content-Length HTTP header to the response for message bodies that//     are greater than 2 GB.//// Parameters://   contentLength://     The length of the response, in bytes.public virtual void SendCalculatedContentLength(long contentLength);//// Summary://     Adds a standard HTTP header to the response.//// Parameters://   index://     The header index. For example, System.Web.HttpWorkerRequest.HeaderContentLength.////   value://     The value of the header.public abstract void SendKnownResponseHeader(int index, string value);//// Summary://     Adds the contents of the specified file to the response and specifies the//     starting position in the file and the number of bytes to send.//// Parameters://   handle://     The handle of the file to send.////   offset://     The starting position in the file.////   length://     The number of bytes to send.public abstract void SendResponseFromFile(IntPtr handle, long offset, long length);//// Summary://     Adds the contents of the specified file to the response and specifies the//     starting position in the file and the number of bytes to send.//// Parameters://   filename://     The name of the file to send.////   offset://     The starting position in the file.////   length://     The number of bytes to send.public abstract void SendResponseFromFile(string filename, long offset, long length);//// Summary://     Adds the specified number of bytes from a byte array to the response.//// Parameters://   data://     The byte array to send.////   length://     The number of bytes to send, starting at the first byte.public abstract void SendResponseFromMemory(byte[] data, int length);//// Summary://     Adds the specified number of bytes from a block of memory to the response.//// Parameters://   data://     An unmanaged pointer to the block of memory.////   length://     The number of bytes to send.public virtual void SendResponseFromMemory(IntPtr data, int length);//// Summary://     Specifies the HTTP status code and status description of the response, such//     as SendStatus(200, "Ok").//// Parameters://   statusCode://     The status code to send////   statusDescription://     The status description to send.public abstract void SendStatus(int statusCode, string statusDescription);//// Summary://     Adds a nonstandard HTTP header to the response.//// Parameters://   name://     The name of the header to send.////   value://     The value of the header.public abstract void SendUnknownResponseHeader(string name, string value);//// Summary://     Registers for an optional notification when all the response data is sent.//// Parameters://   callback://     The notification callback that is called when all data is sent (out-of-band).////   extraData://     An additional parameter to the callback.public virtual void SetEndOfSendNotification(HttpWorkerRequest.EndOfSendNotification callback, object extraData);// Summary://     Represents the method that Notifies callers when sending of the response//     is complete.//// Parameters://   wr://     The current System.Web.HttpWorkerRequest.////   extraData://     Any additional data needed to process the request.public delegate void EndOfSendNotification(HttpWorkerRequest wr, object extraData);}
}
复制代码

该类是一个很底层的类,主要用于asp.net服务器内部,在一些特殊情况下,可以完成一些特殊的任务,比如,上传文件时,默认情况下,asp.net会将上传的文件内容读取到服务器的内存中,然后通过控件的方式供我们使用。这种在上传小文件的时候很方便,大文件的时候,服务器内存将出现问题,导致浏览器不能将文件继续传输。浏览器将显示“The page cannot be displayed -cannot find server or dns error.”,这个错误无法在服务器端进行捕获或者处理。

借助HttpWorkerRequest的GetPreloadedEntityBody和ReadEntityBody方法,我们可以自己分块从客户端读取上传的文件内容。然后将内容保存在一个临时文件中.

SlickUpload组件,就是基于这个实现的。感兴趣的可以看看这篇文章,如何使用该组件。

http://blog.csdn.net/zhoufoxcn/article/details/5765748

 下载源码

http://slickupload.com/

博客地址:http://www.cnblogs.com/wolf-sun/
博客版权:本文以学习、研究和分享为主,欢迎转载,但必须在文章页面明显位置给出原文连接。
如果文中有不妥或者错误的地方还望高手的你指出,以免误人子弟。如果觉得本文对你有所帮助不如【推荐】一下!如果你有更好的建议,不如留言一起讨论,共同进步!
再次感谢您耐心的读完本篇文章。http://www.cnblogs.com/wolf-sun/p/5196384.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/458465.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

苹果应用上架,一些信息的勾选(2017年4月27日)

1、分级的各种选项的选择全部选否 (我们公司是医疗相关的app,医疗的选项也是选择的否) 2、

C# 线程池ThreadPool

什么是线程池?为什么要用线程池?怎么用线程池? 1. 什么是线程池?.NET Framework的ThreadPool类提供一个线程池,该线程池可用于执行任务、发送工作项、处理异步 I/O、代表其他线程等待以及处理计时器。那么什么是线程池…

苹果应用上架,图片的要求(2017年4月27日)

看这个提示应该就明白了吧。 哈哈,我还是自己再说一遍加深一下印象吧:如果应用在各个尺寸iphone屏幕上面外观一样,就只准备5.5英寸的图就可以了;如果有所不同,就按照实际情况,准备不同屏幕尺寸的图片即可。…

android Instrumentation 转载

Android提供了一系列强大的测试工具,它针对Android的环境,扩展了业内标准的JUnit测试框架。尽管你可以使用JUnit测试Android工程,但Android工具允许你为应用程序的各个方面进行更为复杂的测试,包括单元层面及框架层面。Android测试…

【C#学习笔记】使用C#中的Dispatcher

form:https://www.jianshu.com/p/0714fc755988之前的文章说过了如何使用BackgroundWorker,今天要说的是WPF程序员处理多线程的另外一个方式 - Dispatcher当我们打开一个WPF应用程序即开启了一个进程,该进程中至少包含两个线程。一个线程用于处理呈现&…

html body标签

table table 属性&#xff1a; border &#xff1a;定义表格的边框宽度&#xff0c;默认为0&#xff0c;即无边框。<table border"1"> title &#xff1a;表格的提示信息&#xff0c;当鼠标移到表格上方时&#xff0c;所提示的信息。 cellpadding &#xff1a;…

DataReceivedEventHandler 委托 接收调用执行进程返回数据

https://msdn.microsoft.com/zh-cn/library/azure/system.diagnostics.datareceivedeventhandler备注创建 DataReceivedEventHandler 委托时&#xff0c;需要标识将处理该事件的方法。 若要将事件与事件处理程序关联&#xff0c;请将该委托的一个实例添加到事件中。 除非移除了…

coreData

CoreData使用 创建步骤流程 第一步先创建.xcdatamodeld文件&#xff08;New File -> iOS -> Core Data ->Data Model&#xff09; 屏幕快照 2016-07-07 下午10.40.16.png名字虽然可以任意取&#xff0c;但最好还是取和自己存储数据库名字一样的名字。这样可读性更高些…

PetaPoco初体验(转)

PetaPoco初体验&#xff08;转&#xff09; PetaPoco初体验&#xff08;转&#xff09;大部分转自&#xff1a; http://landyer.com/archives/138 PetaPoco C#微型ORM框架&#xff0c;基本无需配置&#xff0c;仅由单个cs文件构成&#xff0c;支持.net3.5 .net4.0。 截稿时Peta…

iOS当中的设计模式

代理模式 应用场景&#xff1a;当一个类的某些功能需要由别的类来实现&#xff0c;但是又不确定具体会是哪个类实现。 优势&#xff1a;解耦合 敏捷原则&#xff1a;开放-封闭原则 实例&#xff1a;tableview的 数据源delegate&#xff0c;通过和protocol的配合&#xff0c…

c#的dllimport使用方法详解

DllImport是System.Runtime.InteropServices命名空间下的一个属性类&#xff0c;其功能是提供从非托管DLL&#xff08;托管/非托管是微软的.net framework中特有的概念&#xff0c;其中&#xff0c;非托管代码也叫本地&#xff08;native&#xff09;代码。与Java中的机制类似&…

VS2010中 C++创建DLL图解

一、DLL的创建 创建项目: Win32->Win32项目&#xff0c;名称&#xff1a;MyDLL 选择DLL (D) ->完成. 1、新建头文件testdll.htestdll.h代码如下&#xff1a;#ifndef TestDll_H_#define TestDll_H_#ifdef MYLIBDLL#define MYLIBDLL extern "C" _declspec(dllimp…

使用公用表表达式的递归查询

微软从SQL2005起引入了CTE(Common Table Expression)以强化T-SQL。公用表表达式 (CTE) 具有一个重要的长处&#xff0c;那就是可以引用其自身。从而创建递归 CTE。递归 CTE 是一个反复运行初始 CTE 以返回数据子集直到获取完整结果集的公用表表达式。 当某个查询引用递归 CTE 时…

C#委托实现C++ Dll中的回调函数

from:https://blog.csdn.net/ferrycooper/article/details/63261771很多的Dll都是C和C写的&#xff0c;那么如果C#想要调用Dll中的函数怎么办&#xff0c;尤其是Dll函数其中一个参数是函数指针的&#xff0c;即里面有回掉函数的用C#怎么实现&#xff1f; C中的回掉函数在C#中有…

15个最好的HTML5前端响应式框架(2014)

文中的多个框架基于SASS创建&#xff0c;SCSS是一种比LESS更简洁的样式表编程语言&#xff0c;它能够编绎成CSS&#xff0c;可复用CSS代码&#xff0c;声明变量&#xff0c;甚至是函数&#xff0c;类Ruby/Python的语法。參见&#xff1a; LESS vs SASS&#xff1f;选择哪种CSS样…

【转载】Direct3D基础知识

原文&#xff1a;Direct3D基础知识 重新从头开始学习DX,以前太急于求成了,很多基础知识都没掌握就开始写程序了,结果出了问题很难解决.1. D3D体系结构D3D与GDI处与同一层次,区别在于,D3D可以使用HAL(Hardware Abstraction Layer)通过DDI来访问图形硬件,充分发挥硬件性能.…

关于Xcode隐藏打印的logs的方法

https://www.cnblogs.com/jukaiit/p/5881062.html 第一步&#xff1a; 第二步&#xff1a; 第三步&#xff1a; 添加参数&#xff1a; Name &#xff1a;OS_ACTIVITY_MODE Value : disable

指针函数与函数指针的区别

首先它们之间的定义&#xff1a;1、指针函数是指带指针的函数&#xff0c;即本质是一个函数&#xff0c;函数返回类型是某一类型的指针。 类型标识符 *函数名(参数表)int *f(x&#xff0c;y);首先它是一个函数&#xff0c;只不过这个函数的返回值是一个地址值。函数返回值必须用…

C++走向远洋——63(项目二2、两个成员的类模板)

*/ * Copyright (c) 2016&#xff0c;烟台大学计算机与控制工程学院 * All rights reserved. * 文件名&#xff1a;text.cpp * 作者&#xff1a;常轩 * 微信公众号&#xff1a;Worldhello * 完成日期&#xff1a;2016年6月4日 * 版本号&#xff1a;V1.0 * 问题描述&…

iOS 抓包工具 charles工具

在Charles官网下载最新的 安装包 在电脑上安装完成之后&#xff0c;以 注册码 Registered Name: https://zhile.io License Key: 48891cf209c6d32bf4 进行注册即可完成 在手机上面设置代理&#xff1a;输入电脑的网络IP以及端口号 以下为查找的步骤&#xff1a; 在手机上手…