我的设置:
我试图从WCF服务返回2个List对象.当我只返回1个List对象时,我的设置工作很精细.但是当我返回2个List对象时,我收到错误:
已超出传入邮件的最大邮件大小限额(65536).要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性.
我知道这个问题在本网站和其他网站上也被多次询问过.我已尝试使用CONFIG FILE的各种组合在互联网上发布的几乎所有内容,但这对我来说仍然没有成功.
客户端配置:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime maxRequestLength="1572864"/>
</system.web>
<system.serviceModel>
<client>
<endpoint name="basicHttpBinding"
address="http://localhost:9502/HCDataService"
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding"
contract="HC.APP.Common.ServiceContract.IHCServiceContract"
behaviorConfiguration="ServiceBehaviour">
</endpoint>
</client>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483646" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="ServiceBehaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Run Code Online (Sandbox Code Playgroud)
服务器配置:
<configuration>
<system.serviceModel>
<services>
<service name="HC.APP.Server.Service.HCDataService" behaviorConfiguration="ServiceBehaviour">
<host>
<baseAddresses>
<add baseAddress="http://localhost:9502/HCDataService"/>
</baseAddresses>
</host>
<endpoint name="basicHttpBinding"
address="http://localhost:9502/HCDataService"
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding"
contract="HC.APP.Common.ServiceContract.IHCServiceContract">
</endpoint>
</service> …Run Code Online (Sandbox Code Playgroud) 环境 - PDFsharp Library,Visual Studio 2012和C#作为语言.
我在尝试着:
我可以做以下所有事情.但是当我打开文件Test2.pdf时,页面的大小会减小到宽度= 11英寸,高度--11英寸.我使用的这些PDF文件是我从互联网上下载的产品规格表.我相信这只发生在某些类型的文件上,我不知道如何区分这些文件.
代码如下:
//File dimentions - Width = 17 inches, Height - 11 inches (Tabloid Format)
PdfDocument pdfDocument = PdfReader.Open(@"D:\Test1.pdf", PdfDocumentOpenMode.Modify);
PdfPage page = pdfDocument.Pages[0];
XGraphics gfx = XGraphics.FromPdfPage(page);
XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);
gfx.DrawString("Hello, World!", font, XBrushes.Black, new XRect(0, 0, page.Width, page.Height), XStringFormats.Center);
//When the file is saved dimentions change to - Width = 11 inches, Height - 11 inches
pdfDocument.Save(@"D:\Test2.pdf");
Run Code Online (Sandbox Code Playgroud)
我在这里上传了文件Test1.pdf
================================================== …
这不是SP是好还是坏的问题.或者在C#中编写SQL语句是好还是坏.
我们很快就开始研究一个典型的库存/计费管理系统的新项目.这将使用.Net和C#作为语言开发.数据库尚未最终确定.
在此应用程序中不允许使用存储过程,它将具有中到复杂的数据库操作.因此,我可以轻松地使用SP编写的逻辑,现在我将不得不使用C#和ADO.Net编写.
现在采取一个非常假的使用案例,客户已经选择了5项并准备好在柜台生成账单.... 这通常会有以下数据库操作:
现在看一下这种情况,可以在SP中轻松完成所有操作.这包含很多查询,IF条件,可能的循环等,看起来像SP的一个很好的竞争者.我想从专家那里得到的是: