草庐IT

http-types

全部标签

c# - 如何编写 HTTP 请求

你好,我尝试用C#(Post)编写HTTP请求,但我需要帮助解决错误说明:我想将DLC文件的内容发送到服务器并接收解密后的内容。C#代码publicstaticvoiddecryptContainer(stringdlc_content){HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create("http://dcrypt.it/decrypt/paste");request.Method="POST";request.ContentType="application/x-www-form-urlencoded";request.

C#:如何使用套接字执行 HTTP 请求?

我正在尝试制作HTTPrequest使用套接字。我的代码如下:usingSystem;usingSystem.Net;usingSystem.Net.Sockets;usingSystem.Text;classtest{publicstaticvoidMain(String[]args){stringhostName="127.0.0.1";inthostPort=9887;intresponse=0;IPAddresshost=IPAddress.Parse(hostName);IPEndPointhostep=newIPEndPoint(host,hostPort);Sockets

c# - 无法加载文件或程序集“System.Net.Http

在我的构建输出的诊断View中显示了这个冲突Therewasaconflictbetween"System.Net.Http,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"and"System.Net.Http,Version=4.1.1.2,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a".(TaskId:20)"System.Net.Http,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f1

SQL注入之HTTP请求头注入

Ps:先做实验,在有操作的基础上理解原理会更清晰更深入。一、实验sqli-lab1.User-Agent注入特点:登陆后返回用户的User-Agent-->服务器端可能记录用户User-Agent输入不合法数据报错payload:'andupdatexml(1,concat("~",database(),"~"),1),'','')--clay数据包POST/sqli-labs/Less-18/index.phpHTTP/1.1Host:10.49.102.86Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/

c# - 编译器错误 : "error CS0307: The variable ' int' cannot be used with type arguments"

如果我有以下代码:privatevoidCheck(boola,boolb){}privatevoidCheck(inta,intb,intc,boolflag){Check(a(flag?c:b-10));}我在调用Check(int,int)时遇到编译时错误:errorCS0307:Thevariable'int'cannotbeusedwithtypearguments我也遇到了这些错误:errorCS0118:'b'isavariablebutisusedlikeatypeerrorCS0118:'a'isavariablebutisusedlikeatype为什么会出现这些错

c# - Type.GetType 返回 null

这个问题在这里已经有了答案:Type.GetType("namespace.a.b.ClassName")returnsnull(17个答案)关闭7年前。我正在尝试使用Type.GetType并传递“caLibClient.entity.Web2ImageEntity”完整类名。caLibClient.entity是命名空间,位于单独的程序集(caLibClient)中并添加到程序引用程序集列表中。当我从程序中调用Type.GetType时,它​​总是返回Null,有什么问题吗?

c# - 如何解决错误 : Inconsistent accessibility: parameter type for generic c# interface?

将此代码写入我的项目时出现错误Error1Inconsistentaccessibility:fieldtype'System.Collections.Generic.List'islessaccessiblethanfield'Jain_milan.addchild.m_children'Error2Inconsistentaccessibility:parametertype'System.Collections.Generic.List'islessaccessiblethanmethod'Jain_milan.addchild.addchild(System.Collectio

c# - System.Web.Http.Owin WebApi2 安装问题

我在.net和NUGet中发现的一件烦人的事情是,我永远不知道默认安装的是什么版本。在尝试向现有项目中添加内容时,这真的很令人沮丧......这是我目前的困境。我有一个只有MVC的MVC5项目。这个项目很大,将它转移到另一个项目的工作会花费太多时间。因此,我打开了NUGet并输入WebApi并安装了随附的那个。然后我创建了一个空白的WebApi项目,其中设置了个人帐户,并将启动代码连同所需的任何其他配置一起复制到我当前的启动中。然后我开始创建我的AccountController,它是直接从我创建的干净项目中复制的。它看起来像这样:[Authorize][RoutePrefix("ap

C# 泛型 : cast generic type to value type

我有一个泛型类,它保存指定类型T的值。该值可以是int、uint、double或float。现在我想获取值的字节以将其编码为特定协议(protocol)。因此我想使用方法BitConverter.GetBytes()但不幸的是Bitconverter不支持泛型类型或undefinedobject。这就是为什么我要转换值并调用GetBytes()的特定重载。我的问题:如何将通用值转换为int、double或float?这不起作用:publicclassGenericClasswhereT:struct{T_value;publicvoidSetValue(Tvalue){this._va

c# - 错误 : Native images generated against multiple versions of assembly System.Net.Http.Primitives

我在我的WP8.1应用程序中遇到了这个错误,Application_UnhandledExceptionERROR:NativeimagesgeneratedagainstmultipleversionsofassemblySystem.Net.Http.Primitives.atCoolEditor.Class.DropNetRt.DropNetClient.LoadClient()atCoolEditor.Class.DropNetRt.DropNetClient..ctor(StringapiKey,StringappSecret)atCoolEditor.MainPage.d_