c#-2.0

Not enough memory or not enough handles?

核能气质少年 提交于 2019-12-24 17:23:56
问题 I am working on a large scale project where a custom (pretty good and robust) framework has been provided and we have to use that for showing up forms and views. There is abstract class StrategyEditor (derived from some class in framework) which is instantiated whenever a new StrategyForm is opened. StrategyForm (a customized window frame) contains StrategyEditor . StrategyEditor contains StrategyTab . StrategyTab contains StrategyCanvas . This is a small portion of the big classes to clarify

Not enough memory or not enough handles?

假如想象 提交于 2019-12-24 17:23:55
问题 I am working on a large scale project where a custom (pretty good and robust) framework has been provided and we have to use that for showing up forms and views. There is abstract class StrategyEditor (derived from some class in framework) which is instantiated whenever a new StrategyForm is opened. StrategyForm (a customized window frame) contains StrategyEditor . StrategyEditor contains StrategyTab . StrategyTab contains StrategyCanvas . This is a small portion of the big classes to clarify

Improve the performance of a panel OnMouseMove method for a signature control

谁都会走 提交于 2019-12-24 10:49:14
问题 I have a Windows Mobile application (C#, .Net framework 2), the codebase of which is also now being used to run on Windows 7 and Windows 8. One of the controls that we wrote for this application is a scribble control that allows the user to capture a signature. This control works ok on Windows Mobile and can be used to capture signatures fairly well. On Windows, however, the OnMouseMove override method of a panel control is too slow, or called to infrequently, and the signature becomes very

Modifying Existing XML Content in C#

我的未来我决定 提交于 2019-12-24 06:55:26
问题 I found some examples about this subject. Some of the examples gived a method to modify attribute with SelectNodes() or SelectSingleNode() , and others gived the method to modify attribute with someElement.SetAttribute("attribute-name", "new value"); But I still confused that how to build the relation if I only used a XpathNodeItterator it ? Assumed I defined as below, System.Xml.XPath.XPathDocument doc = new XPathDocument(xmlFile); System.Xml.XPath.XPathNavigator nav = doc.CreateNavigator();

Modifying Existing XML Content in C#

淺唱寂寞╮ 提交于 2019-12-24 06:55:11
问题 I found some examples about this subject. Some of the examples gived a method to modify attribute with SelectNodes() or SelectSingleNode() , and others gived the method to modify attribute with someElement.SetAttribute("attribute-name", "new value"); But I still confused that how to build the relation if I only used a XpathNodeItterator it ? Assumed I defined as below, System.Xml.XPath.XPathDocument doc = new XPathDocument(xmlFile); System.Xml.XPath.XPathNavigator nav = doc.CreateNavigator();

Implementing SFTP in 2.0

橙三吉。 提交于 2019-12-24 03:55:16
问题 I want to write SFTP clients and servers in .NET 2.0. Is that possible? Please give me some suggestions 回答1: Take a look at SharpSSH. It has an open source BSD-style license and supports SCP and SFTP. 回答2: The .NET Framework 2.0 does not include any support for SSH/SFTP. You probably have to try one of third party solutions. Our Rebex SFTP for .NET can be worth checking. Check the samples and tutorials to see if it fits your needs. 回答3: If you want a commercial package, take a look at

Is Interop.Domino dll thread safe?

拜拜、爱过 提交于 2019-12-23 20:31:05
问题 I am using Interop.Domino dll version 1.2 in c# application, and using multithreading to access multiple NSF file at same time by creating new session for each thread created (Max 5 threads at a time). For the large NSF files, I was getting the Notes error like memory segment overflow. To overcome this problem, i used Marshal.ReleaseComObject(object) to release the necessary Notesdocument, and NotesView object where ever possible. Now, the issues is like, i am able to access 2 NSF files but

Validating with DTD - connection forcibly closed

◇◆丶佛笑我妖孽 提交于 2019-12-23 17:37:53
问题 I'm validating a document with the DTD in the document which is not on my machine, it is stored on the internet. I am currently getting the following exception System.Xml.XmlException: An error has occurred while opening external DTD 'http://xml.cxml.org/schemas/cXML/1.2.020/cXML.dtd': Unable to connect to the remote server ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

ArrayList vs Generic collections

人走茶凉 提交于 2019-12-23 16:28:00
问题 what are pros and cons to use ArrayList instead generic collection in NET 2.0 回答1: Generic collections are type-safe - you cannot put a string into a List<int> - and don't require constant boxing/unboxing from object . ArrayList on the other hand can handle a mix of different elements - this can be a plus in certain cases. My take: typically I always use List<T> - unless I really need something that can handle int, string, DateTime etc. at the same time (very rare occasions). 来源: https:/

How to read contents of specific page from PDF using itextsharp APIs

删除回忆录丶 提交于 2019-12-23 16:05:44
问题 How to read contents of specific page from PDF using itextsharp APIs Can anybody redirect me to the correct direction? Thanks in advance! 回答1: The following code only extracts text, if that is what you are looking for. PdfReader pdfReader = new PdfReader(documentPath); ITextExtractionStrategy its = new iTextSharp.text.pdf.parser.SimpleTextExtractionStrategy(); //Extract text from the page. string txt = PdfTextExtractor.GetTextFromPage(pdfReader, page, its); // Convert the extracted text into