.net

Observer pattern with WCF MSMQ

Is it possible to have multiple listeners to messages carried by MSMQ? WCF appears to frame everything in terms of services, making communication a point-to-point affair. I want to use a message queue to buffer incoming traffic for another process that records the logs in a database. There can be be any number of other processes inter...

How can I build a single instance application using Click Once?

I need to have a single instance application (as per this answer), but it needs to be deployed via click once. The problem is that I require that click once doesn't automatically detect an update an attempt to load a newer version while the application is running. If it is running, then I need the other instance to be made active. Usua...

Is there a .NET equivalent of Java Web Start?

Is there a .NET equivalent of Java Web Start? I want a one-click, from the web, lightweight install for a group of .NET assemblies and resources. Hopefully, the link would continue to keep the user updated with the latest version, similar to what Java Web Start does. The application is written in F#, for what it's worth. ...

If object is Generic List

Is there any way to determine if an object is a generic list? I'm not going to know the type of the list, I just know it's a list. How can I determine that? ...

Removing databound item from listbox causes refresh problems

I have databound a listbox to a simple custom object collection. Next, I added a button to remove the selected item from the object collection. The problem is that when certain items are removed and the listbox is showing the vertical scroll bar, the scrollbar appears to reset to a new position, although what I really think is happenin...

Is it possible to modify a method body at run-time in .NET?

I know that it is possible (in theory) to create a new type at run-time, but is it possible to modify a method body of an existing type at run-time? My plan (if I can get this to work) is to tag up methods with a custom attribute, and then at run-time search for methods with the attribute, and insert some of my own code into the method b...

SMTP and IMAP server library for .net

Hi, does anyone know good SMTP/IMAP server libraries for C#? I only found some long abandoned projects. Only SERVER SIDE libraries, please no more posts about client libs. Thanks, Fionn ...

How to avoid HttpRequestValidationException in ASP.NET MVC rendering the same view which caused the exception

I just want to know how to validate (or clean) user input in ASP.NET MVC so that an HttpRequestValidationException will not be thrown regardless of the values submitted. For example, with a text input, if the user inputs <BR/>, it will cause an exception and the Yellow Screen of Death will be shown. I don't want that. I want to catch t...

How do I remove diacritics (accents) from a string in .NET?

I'm trying to convert some strings that are in French Canadian and basically, I'd like to be able to take out the French accent marks in the letters while keeping the letter. (E.g. convert é to e.) What is the best method for achieving this? ...

What is a good design pattern in C# for classes that need to reference other classes?

I am working on a business problem in C#.NET. I have two classes, named C and W that will be instantiated independently at different times. An object of class C needs to contain references to 0 ... n objects of class W, i.e. a C object can contain up to n W objects. Each W object needs to contain a reference to exactly 1 object of cla...

What is the best .net Micro Framework dev board, for under $300?

I'm looking for a relativity cheap .net Micro Framework development board for use on a personal robotics project. I'd don't need much for I/O, but I want at least one serial port and one Ethernet port. I would prefer not to have to spend more than $300 on the board, but if there is an obvious reason to get a better one I'm flexible. ...

Custom collections - still worth the extra work?

Excuse me if I'm off on my terminology, I only have around 2.4 years of programming experience, mostly in .NET. Currently I'm one of two .NET developers in a mainframe shop, the other developer set the standards and is a great coder with a lot more experience plus a CS degree(I am 100% self taught). We use custom collections for every...

ASP.NET AJAX Page Methods from UserControl

I would like to utilize the ASP.NET AJAX Page Methods functionality with a user control. Is there a way to be able to specify my static [WebMethod] inside the UserControl's code behind instead of the Page's code behind? ...

Data binding formatting to a DateTime column

I have a textbox with the Text property bound to a dataset column with the DataType set to System.DateTime. The FormatString on the Binding is set to dd-MM-yyyy. When the user enters a date it attempts to convert it to a date but can come up with some strange values for a seemingly invalid date. For example: textBox1.Text = "01-02-200...

Add new item in existing array in c#.net

How to add new item in existing string array in c#.net. i need to preserve the existing data. ...

Converting VB code tied to Access into C# / .NET

Hi, I am facing problems in converting code from VB to C# / .NET. The database backend is Access. Thanks in advance, Mahesh ...

How to present credentials in order to open file?

How do I specify the username and password in order for my program to open a file for reading? The program that needs to access the file is running from an account that does not have read access to the folder the file is in. Program is written in C# and .NET 2, running under XP and file is on a Windows Server 2003 machine. ...

What ORM frameworks for .NET Do You Like Best?

I'm writing an application from scratch, I am not pretty sure which one to use. Microsoft Entity Framework NHibernate Gentle.NET Other Any guidance or opinions on the advantages and disadvantages of each would be helpful. ...

Algorithm to avoid SQL injection on MSSQL Server from C# code?

What would be the best way to avoid SQL injection on the C#.net platform. Please post an C# implementation if you have any. ...

How to get started on Aspect Oriented Programming on the .Net platform?

Please give me some insight on how to get the best start on applying Aspect Oriented Programming to my C#.net applications? ...