.net

LINQ How to search data from large XML file?

Hi I have an xml file with about 500 mb and i'm using LINQ with c# to query that file, but it's very slow, because it loads everything into memory. Is there anyway that i can query that file without loading all into memory? Thanks ...

How to dispose when application crashes

Hi, got a issue: I create singleton helper object that wraps PerformanceCounter objects. It implements IDisposable... But now I have spotted that when I close my test sample console host application, counters are still visible in perfmon tool (in production I will be hosted in Windows Service) , and are still running. I figured out th...

How to let StringTemplate.NET to load template files with the extension ".dwt"?

The default template file extension of StringTemplate is ".st". Now I have several template files in a folder and their file extension is ".dwt". Is there a way to change the default template file extension and load all of them like below: StringTemplateGroup group = new StringTemplateGroup("views", viewPath); ...

Resources for learning about the CLR

Can anyone suggest any books or websites which go into detail about how the CLR works? I've been trying to learn more about the detail of how my applications execute, but have found a relatively small number of resources. There are a few great blog posts on MSDN, such as this one about object lifecyles. I've also recently bought Jeffrey...

MonoTorrent: no peers connecting apart from webseeds

Hi, I've built a program based on MonoTorrent, which automatically downloads updates for a game. My problem is that no peers ever connect (neither while leeching or seeding), except for webseeds. (I tried it having 3 seeders: webseed, seeding with uTorrent and seeding with the same MonoTorrent client. Only the webseed ever connected, if...

Way to get unique filename if specified filename already exists (.NET)

Is there a built in .NET function to get a unique filename if a filename already exists? So if I try and save MyDoc.doc and it already exists, the file will save with name MyDoc(1).doc, the same way a browser download works for example. If not, what is the most efficient way to achieve this result? I am using the File.Move function at ...

consume gsoap webservice from .NET client

From a .NET application, how do I consume a Web Service developed using gSoap c/C++ library? I can create a C/C++ client using gSoap library to consume the web service. But I need to consume it from within a .NET (C#) application. I tried Adding a Web Reference but that doesn't seem to work. Would I need to work with raw Soap Packets?...

Regex test for NUMBERS

I have found a Regex that test if the text passed to a TextBox is an email. If Regex.IsMatch(email.Text, "^(?("")("".+?""@)|(([0-9a-zA-Z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-zA-Z])@))" + "(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,6}))$") _ Then // True End If I want to change thi...

MSMQ BeginPeek/PeekCompleted memory leak

Using Microsoft MessageQueue there seem to be a memory leak related to the PeekCompleted event. I found a related question on experts exchange from 2005, but with no proper answer/solution: http://www.experts-exchange.com/Programming/Misc/Q_21387840.html Using ANTS Memory Profiler I can see that I get additional pinned instances of Byte...

.NET WebReference to Webservice - generating interface together with proxy class

Hello I have a WebService project in VS2005 and a Mobile Device .NET CF project. I add web reference to the WebService and thus I have a Reference.cs generated with proxy class. My problem is that I'd also like to have the pure interface generated and the proxy class to implement this interface. I want to use this interface to provide a...

Is there a simple way to pull in the outlook message folder information in vs2010/.net 4.0 office 2007?

I'm building an outlook add-in to get around whatever the reasoning is you can't create a rule to sort mail based on a Distribution Group (error message about it being a personal distribution group). I've gotten really far and I think all the core functionality works, but I can't seem to figure out how to allow the user to drag/drop the...

How can I improve performance when inserting list items using Sharepoint web services

Hi, Does anyone have any recomendations of how to improve the performance of the UpdateListItems function (Within Lists.asmx) Im finding that it takes around 1-2 seconds to insert a new item, is this normal? Heres the code im which im running inside a loop, which runs about 1000 times Dim xmlDoc As New System.Xml.XmlDocument() Dim...

how can I extract an XML block from an XML document?

I want to extract a chunk of XML from a larger XML document. For example, my XML document looks like this <?xml version="1.0" encoding="utf-8"?> <Root> <CONTAINER> <FIRSTNODE> <CHILDNODE> </CHILDNODE> </FIRSTNODE> </CONTAINER> </Root> If I wish to extract any portion. For example, I wish to extract everythi...

Obsfuscating C# code

Possible Duplicates: Protect .NET code from reverse engineering? What do you use to protect your .NET code from reverse engineering? How can I protect my .NET assemblies from decompilation? Given that C# can be reflected and decompiled, can you suggest how I can obsfucate my code or protect it from reverse engineering? ...

Issue with the configuration of HTTPS WCF hosted on Azure

Hi, I using a third party secure WCF service hosted on Azure . I am trying to create my own secure HTTPS service but I am not able to use it. I am able to host it on Azure however when I use it in a client application I got following error "There was no endpoint listening at https://xxxx.cloudapp.net/AsycServ/ AsycServCallback .svc tha...

Implementing footnotes in a WPF FlowDocument

What would be the best approach to display footnotes for FlowDocument content in a FlowDocumentPageViewer? My first thought was to have the contents of the footnote follow immediately after the footnote anchor within the FlowDocument, with the footnote content formatted as a Figure with VerticalAnchor set to PageBottom. This works grea...

How to programmatically modify My.Log settings configuration

Hello, we have several applications in Vb.Net using the built in log system (My.Log) to write log information. Until now this system was configured by the application.config file before execution but now we want to let the user to choose some options. Is there a way that does not requires to parse the XML file and process it? Is there ...

.NET garbage collector and x64 virtual memory

Running a .NET application on Windows Server 2008 x64 with 16GB of RAM. This application needs to fetch and analyze a very large amount of data (about 64GB), and keep it all in memory at one time. What I expect to see: Process size expands past 16GB to 64GB. Windows uses virtual memory to page the extra data to/from disk as needed. This...

List of Generic Lists

I would like to create a list of objects in which there is a generic list. So what I have is this object: public class agieDBColumn where dataTp:IComparable{ private string _header; private string _longHeaderName; private List _data; public string header { get { return _header; } set { _header = value; } } public string longH...

Not grouping by date?

I have a database table that stores document information (DocID, Name, Type, Owner, etc). Then I have another table that stores the times the document has been downloaded (DocID, DownloadTime, etc). I'm trying to set up a page for recording the number of hits that different kinds of documents (policies, forms, publications, etc) get in a...