jjzjj

specifiers

全部标签

c# - 错误 (HttpWebRequest) : Bytes to be written to the stream exceed the Content-Length bytes size specified

我似乎无法弄清楚为什么我不断收到以下错误:BytestobewrittentothestreamexceedtheContent-Lengthbytessizespecified.在以下行:writeStream.Write(bytes,0,bytes.Length);这是一个Windows窗体项目。如果有人知道这里发生了什么,我肯定会欠你一个。privatevoidPost(){HttpWebRequestrequest=null;Uriuri=newUri("xxxxx");request=(HttpWebRequest)WebRequest.Create(uri);request

c# - "Compile with/main to specify the type that contains the entry point."

根据下面的代码,我收到以下消息。我相当确定我得到它的“原因”,我只是不知道如何重新排列代码以移动/删除/替换导致错误的语句之一。“使用/main编译以指定包含入口点的类型。”"staticvoidMain(string[]args)"下有一堆代码,我从http://support.microsoft.com/kb/816112为了从自动递增中获取ID,所以当其余代码填充Access数据库时,我可以让它自动递增。任何帮助表示赞赏。也欢迎使用更简单的代码获得结果的建议!namespaceWindowsFormsApplication1{publicpartialclassForm1:For

c# - XSD 工具在生成 C# 代码时将 "Specified"附加到某些属性/字段

我无法真正解释XSD生成器的奇怪行为。我有一个像这样的XSD:SomeDoc............它派生自CoreObject:...这只是XSD的一小部分,还有很多更复杂的类型。所以当我生成类似于this的类时,我得到一个生成的类,它有两个属性(除了我期望的5个属性):publicboolMinDuration_100msSpecified和publicboolStageOnDemandSpecified因此“原始”属性被附加了“Specified”,类型现在是bool。谁能解释为什么会这样? 最佳答案 bool属性表示相关属性

c# - "Both use the XML type name X, use XML attributes to specify a unique XML name and/or namespace for the type"怎么解决?

我有以下枚举定义...namespaceItemTable{publicenumDisplayMode{Tiles,Default}}namespaceEffectiveItemPermissionTable{publicenumDisplayMode{Tree,FullPaths}}...然后我有以下类(class)...publicclassTablewhereTDisplayMode:struct{//publicpublicTDisplayModeDisplayMode{get{returnmDisplayMode;}set{mDisplayMode=value;}}//pri

c# - 编译器错误 "Default parameter specifiers are not permitted"

下面是我的代码。publicclassPItem{publicStringcontent;publicintcount;publicintfee;publicintamount;publicstringdescription;//DefaultvaluespublicPItem(String_content="",int_count=0,int_fee=0,string_description="",int_amount=0){content=_content;count=_count这是在一个类里面。当我尝试运行程序时出现此错误:Defaultparameterspecifiersa

c# - .Net4 中的 GC : Specifying gcServer and gcConcurrent together

我正在调整我们的服务器性能,并尝试指定以下配置,并将GCLatencyMode设置为LowLatency。这提高了我的性能,直到一位同事指出这两个设置在.Net4中是互斥的,我才感到非常高兴。那么这将解析到什么配置?当然,GCSettings.IsServerGC返回true,将gcConcurrent设置为false会带来非常明显的性能提升。(我将我正在分析的代码编译成一个测试工具,所以虽然它通常是由IIS托管的服务器,但我的所有计时都在控制台应用程序上) 最佳答案 我在这里找到了你的答案:LatencyModesDefaultG

c# - 如何强制 Newtonsoft Json 序列化所有属性? (具有 "Specified"属性的奇怪行为)

各位程序员,我在Newtonsoft.Json中遇到了一个奇怪的行为。当我尝试序列化一个如下所示的对象时:publicclassDMSDocWorkflowI{[JsonProperty("DMSDocWorkflowIResult")]publicboolDMSDocWorkflowIResult{get;set;}[JsonProperty("DMSDocWorkflowIResultSpecified")]publicboolDMSDocWorkflowIResultSpecified{get;set;}}使用这个没有自定义转换器/绑定(bind)器/契约解析器的简单调用:var

c# - 三重 DES : Specified key is a known weak key for 'TripleDES' and cannot be used

我正在使用.NET3.0类System.Security.Cryptography.MACTripleDES类来生成MAC值。不幸的是,我正在使用使用“1111111111111111”(十六进制)作为单一长度DESkey的硬件设备。System.Security.Cryptography库会对key进行完整性检查,如果您尝试使用加密强度较弱的key,则会返回异常。例如:byte[]key=newbyte[24];for(inti=0;i抛出异常System.Security.Cryptography.CryptographicException:Specifiedkeyisaknow

c# - 这是错误 ORA-12154 : TNS:could not resolve the connect identifier specified?

我有这段代码:OracleConnectioncon=newOracleConnection("datasource=localhost;userid=fastecit;password=fastecit");con.Open();stringsql="SelectuserIdfromtblusers";OracleCommandcmd=newOracleCommand(sql,con);OracleDataReaderdr=cmd.ExecuteReader();while(dr.Read()){messageBox.Show(dr[0].Tostring());}两个项目中的代码相

c# - C# 窗体程序中的 "Specified cast is not valid"错误

我遇到“指定的转换无效”错误。C#中的Windows窗体应用程序。我正在尝试从表中检索值。该值要么是smallint,要么是数字(我尝试了两个字段,都给我同样的错误),我尝试将它存储在一个int变量中。这是来源:using(SqlDataReaderrdr=cmd.ExecuteReader())//"select*fromtablewherefieldname="+value{while(rdr.Read()){intnumber=(int)rdr["quantity"];//errorishere 最佳答案 rdr["quant