草庐IT

text-processing

全部标签

c# - System.Text.Encoding.GetEncoding ("iso-8859-1") 抛出 PlatformNotSupportedException?

看题目,注意这个问题只适用于.NETcompact框架。这发生在WindowsMobile6ProfessionalSDK附带的模拟器以及我的英语HTCTouchPro(所有.NETCF3.5)上。iso-8859-1代表西欧(ISO),这可能是除us-ascii之外最重要的编码(至少在usenet帖子数量上是这样)。我很难理解为什么不支持这种编码,而支持以下编码(同样在模拟器和我的HTC上):iso-8859-2(中欧(ISO))iso-8859-3(拉丁语3(ISO))iso-8859-4(波罗的海(ISO))iso-8859-5(西里尔字母(ISO))iso-8859-7(希腊语

c# - 响应消息的内容类型 application/xml;charset=utf-8 与绑定(bind)的内容类型不匹配 (text/xml; charset=utf-8)

我尝试使用独立应用程序使用WCFWeb服务。我可以使用InternetExplorer查看此服务,也可以在VisualStudio服务引用中查看。这是我遇到的错误Thecontenttypetext/html;charset=UTF-8oftheresponsemessagedoesnotmatchthecontenttypeofthebinding(text/xml;charset=utf-8).如何更改它以使用正确的内容类型?这是我的配置文件这是堆栈{System.ServiceModel.ProtocolException:Thecontenttypeapplication/xm

c# - HTML 敏捷包 : create html text node

在HtmlAgilityPack中,我想创建HtmlTextNode,这是一个HtmlNode(继承自HtmlNode)具有自定义InnerText。HtmlTextNodeCreateHtmlTextNode(stringname,stringtext){HtmlDocumentdoc=newHtmlDocument();HtmlTextNodetextNode=doc.CreateTextNode(text);textNode.Name=name;returntextNode;}问题是textNode.OuterHtml和textNode.InnerHtml在上述方法之后将等于“文

c# - 公开课 - "is inaccessible due to its protection level. Only public types can be processed."

我正在做一个测试项目来了解对象的XML序列化,但我遇到了一个奇怪的运行时错误:namespaceSerializeTest{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}privatevoidForm1_Load(objectsender,EventArgse){}privatevoidserializeConnection(Connconnection){XmlSerializerserializer=newXmlSerializer(typeof(Conn));TextWritertextWrit

c# - Process.WaitForExit 跨机器不一致

此代码在大量机器上按预期运行。然而在一台特定的机器上,调用WaitForExit()似乎被忽略,实际上将进程标记为已退出。staticvoidMain(string[]args){Processproc=Process.Start("notepad.exe");Console.WriteLine(proc.HasExited);//AlwaysFalseproc.WaitForExit();//BlocksonallbutonemachinesConsole.WriteLine(proc.HasExited);//**SeecommentbelowConsole.ReadLine();

c# - 无法处理消息,因为内容类型 'application/json; charset=utf-8' 不是预期的类型 'text/xml; charset=utf-8'

我在通过ajaxjson调用WCF服务时收到上述响应。我的调用代码是:$(document).ready(function(){$.ajax({type:"POST",contentType:"application/json;charset=utf-8",url:"http://localhost:90/WebServices/UserService.svc/Calculate",data:"{}",timeout:10000,dataType:"json",success:function(response){alert(response)},error:function(xhr,

c# - 执行存储过程时,使用 CommandType.StoredProcedure 与使用 CommandType.Text 相比有什么好处?

所以在C#中使用存储过程我有如下代码(省略连接代码):stringsql="GetClientDefaults";SqlCommandcmd=newSqlCommand(sql);cmd.CommandType=CommandType.StoredProcedure;//其中sql是存储过程的名称。现在,无论有没有注释行,这段代码似乎都能正常工作。那么,我需要这条线吗?设置这个是否有一些性能(或其他)好处?不设置它或将其设置为文本有好处吗? 最佳答案 根据thisblogpost中的测试当您使用CommandType.Text时,S

c# - 数据类型 text 和 varchar 在 C# 中的等于运算符中不兼容

我正在尝试从employeeTable访问数据empname,但我编写的代码出现以下错误:Thedatatypestextandvarcharareincompatibleintheequaltooperator.请提出解决方案privatevoidcomboBox1_SelectedIndexChanged(objectsender,EventArgse){stringConnection="DataSource=(local);Initialcatalog=Test;IntegratedSecurity=true";stringQuery="SELECT*FROMEmployeeT

c# - 为什么 Process.Start ("cmd.exe", process);不行?

这个有效:Process.Start("control","/nameMicrosoft.DevicesAndPrinters");但这不会:(它只是打开一个命令提示符。)ProcessStartInfoinfo=newProcessStartInfo("cmd.exe");info.Arguments="control/nameMicrosoft.DevicesAndPrinters";Process.Start(info);为什么?(是的,我知道它们并不相同。但第二个“应该”有效。) 最佳答案 这是因为cmd.exe需要/K开关

c# - 获取 "The WebResource.axd handler must be registered in the configuration to process this request."错误

我在IIS7上运行我的ASP.NET应用程序时遇到此错误。我已经尝试按照它说的去做,但没有帮助。TheWebResource.axdhandlermustberegisteredintheconfigurationtoprocessthisrequest.>>>>>>>>>我正在使用一点AJAX,我认为这是导致问题的原因。有人遇到过这个吗? 最佳答案 我想通了,所以出于搜索原因我将其张贴在这里。这是ASP.NET中的一个错误,它与安装ColdFusion有关。Microsoft尚未发布修复程序。有两种方法可以解决这个问题。将IIS7