.net

How to create a web-based Email Client in .NET?

I am creating a web based email client in .NET using a 3rd party component. I just want to make sure I have the right idea: I will first pull the emails in using POP I will then parse each individual message that I got from POP using the MIME component right? My choices for 3rd party are: Nsoftware, Quiksoft or Dart. I am looking a...

software that store data in flat file, what are common encoding/file format techniques

Hi, I have been spoiled by either using sql server to store data, or using xml files. What are common techniques for storing data in flat files other than xml and CSV. I know many times when I open files that data is all jumbled up, which means it is encoded right? Are there any common techniques that I could read about somewhere? ...

Visual Studio 2008 Fatal Execution Engine Error (7A2E0F92)

Visual Studio 2008 will suddenly quit when I'm manipulating the WebBrowser control in my WPF application. This is in the Event Log: .NET Runtime version 2.0.50727.3053 - Unrecoverable system error. .NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A2E0F92) (0) Does anyone know a cause or workaround fo...

Should I put my timer to sleep when my main method is running in a windows service

Hi, In my .net windows service, when my timer elapses and my main method is called, is it best practice to put the timer in sleep mode? This is in case my main method runs for too long, and the timer elapses before the previous calls main method finishes its execution. ...

When would you ever use In-Proc WCF Components?

I'm studying Juval Lowy's excellent Programming WCF Services and I've just created a really simple in-proc component using his InProcFactory class that comes along with his ServiceModelEx library. Why would you do this instead of using just regular classes in your project? Using his method requires referencing his library and creating ...

How to remove the mouseover highlight and selected row highlight in a Silverlight datagrid

I've got a datagrid with one button in each row (xaml shown below). I'm trying to get rid of the blue highlighting functionality where it highlights the selected row, and the row with the mouse over it. I'm trying to seit it up so you just click on the button without getting the row selection and mouseover highlight functionality. I tr...

C# Code/Algorithm to Search Text for Terms

We have 5mb of typical text (just plain words). We have 1000 words/phrases to use as terms to search for in this text. What's the most efficient way to do this in .NET (ideally C#)? Our ideas include regex's (a single one, lots of them) plus even the String.Contains stuff. The input is a 2mb to 5mb text string - all text. Multiple hi...

In what circumstances should I use a Singleton class?

Closed as exact duplicate of this question. But reopened, as the other Singleton questions are for general use and not use for DB access I was thinking of making an internal data access class a Singleton but couldn't convince myself on the choice mainly because the class has no state except for local variables in its methods. What is ...

How do I install IronPython 2.0 with NGEN'ed binaries?

Does anyone know how to install IronPython 2.0 with NGEN'ed binaries using the MSI package? The official IronPython homepage says that the NGEN option will greatly improve startup time, but for some reason it is not enabled by default. It doesn't actually state which MSI parameters you need pass to enable it, and I couldn't find a docu...

Do you use AOP? and what for?

Hi All, I am very interested in Aspect Orientated Programming (Spring, PostSharp etc). I can think of a couple of ways I would employ this, mainly logging or lazy load comes to mind. I was hoping to see what everyone else used it for? Please list out the senarios you solve using AOP. (hopfully it may inspire some one else to pick it u...

How can I convince skeptical colleagues about proper namespaces in .Net?

Hi all, My team is working on a conversion project to convert one product (but with many facets) from VB6 to .Net (we have over ~300k LOC). Before I got on board, the decision was made that regardless of the location of the assembly, or folder structure, all classes / structs will be in one namespace: . They even go as far as changing...

How to retrieve duration of MP3 in .NET?

I have build a WPF application where users can drag and drop MP3 files onto a listbox. I need a way to calculate the total duration of the playlist. Any libraries I should use? Or is it possible using only the .NET framework? ...

How to write a desktop app that would read/write data to a symbian phone connected to the PC

Hi, I would like to create a desktop application (preferably in c#, running on .net or mono) that would read/write information (phone book, calendar, calls, text messages, etc.) from/to my connected (usb/bluetooth) symbian phone (SE p990i), but I don't seem to be able to pick up the right keywords to google for it, hence cannot get star...

IndexOutOfRangeException for an IList<T>

I am implementing a list, and I am wondering about the definition of the IndexOutOfRange. Which one of the following do you think is better? /// <exception cref="IndexOutOfRangeException">if index is less than 0 /// or greater than <see cref="Count"/> public T this[int index] { get { return myArray[index]; } } Or /// <exception cref=...

How to ensure all data has been physically written to disk?

I understand that .NET FileStream's Flush method only writes the current buffer to disk, but dependent on Windows' disk driver and the hard disk firmware this is no guarantee that the data is actually physically written to disk. Is there a .NET or Win32 method that can give me this guarantee? So if there is power loss one nanosecond aft...

Does using ReaderWriterLockSlim cause a memory barrier?

If I am using ReaderWriterLockSlim to acquire read/write locks, do I need to make my variables volatile or use Interlocked.Increment? For example, would the code in the Add method below work fine, or does it need enhancement? public class AppendableList<T> { // semi-immutable; supports appending only private T[] data = new T[16]; ...

How do you see the future of .NET versus JAVA?

For last couple of years it seemed like .NET was gaining a lot of ground, there were articles out there predicting that .NET eventually will "outdo" Java, but lately it seems like the .NET hype kind of slowed down as Java is still going strong (maybe it's only me who sees it that way). How do you see these 2 technologies in the future? ...

how to show highlighting arrows like in Coderush

I am programming winforms using c# and vb.net. I love the arrows used in coderush. for those who have not seen coderush arrows ,please see this image. http://www.aspnetpro.com/productreviews/2004/08/asp200408bn_p/asp200408bn_p_image002.jpg I want to have something similar in my program. only difference is i will be using it to hi...

How do you loop through currently loaded assemblies?

I've got a "diagnostics" page in my ASP.NET application which does things like verify the database connection(s), display the current appSettings and ConnectionStrings, etc. A section of this page displays the Assembly versions of important types used throughout, but I could not figure out how to effectively show the versions of ALL of ...

Slow methods calls

Are methods calls really so slow or is there something wrong in my computer? static void Main(string[] args) { Stopwatch sw = new Stopwatch(); sw.Start(); for (int i = 0; i < 10000000; i++) { double z = Math.Pow(i,2); } Console.WriteLine(sw.ElapsedMilliseconds); sw = Stopwatch.StartNew(); for (int i = 0;...