.net

What's the proper naming convention for a property 'ID' : ID or Id ?

Pretty simple question: When i have a persistable object, it usually has a property called ID (for abstract classes). So .. is the naming convention ID or Id? eg. public int ID { get; set; } or public int Id { get; set; } cheers :) PS. This is for .NET btw. FXCop conformat would be a bonus. ...

What is the best mechanism for storing authentication settings in a WinForms app

I have an App that will send authenticated emails using System.Net.Mail and System.Net.NetworkCredential my question is how should I store the password that is needed to create a NetworkCrednetial object? The application doesn't have a login but I could setup an option that allows the user to enter their email credentials (in almost all...

Is it worth switching from Visual Studio 2005 to Visual Studio 2008 ?

As a team we are using Visual Studio 2005 with framework 3.0. I am thinking if it will be nice for us to switch to Visual Studio 2008 with framework 3.5 ? Is it worth it ? Thanks. ...

How to get the up time of the machine?

I would like to display the up time of the machine my code is running, how can I do that? ...

System.DirectoryServices problem

I'm trying to use System.DirectoryServices in a web site project and I'm getting this error: The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?) My project has a reference to System.DirectoryServices in web.config: <add assembly="System.DirectoryServices, Versi...

Generate dump with unmanaged code crash?

Is there a way that I can get a full crash dump when my application crashes suddenly? The problem is that I suspect that it's due to unmanaged code that kills the .net framework itself, and because of that, unless there's a debugger attached to the application at the moment of the crash, the application doesn't even gets a chance to ha...

What is the best and/or most comprehensive book on .NET security for developers?

What is the best and/or most comprehensive book on .NET security for developers? ...

C# equivalent of std::sort and std::unique

I have a list of integers in C#. I wish to remove duplicates. In C++ I would run it through the std::sort and then std::unique algorithms for a very efficient way of obtaining the unique list. What's the best way to do the same thing in C#? In other words, I'm looking for a more elegant way to do the following code: private static...

Sql Clr User Defined Type parsing a float and losing precision.

I've got a Clr user defined type that takes a string of values sepertated by a comma. I'm losing a little bit of precision when converting to this type, I've narrowed it down to this line of code: cast(cast(nlinkjt as nvarchar(100)) + ',' +cast(avglrwf as nvarchar(100)) + ',' + cast(avglrwfjt as nvarchar(100)) as dbo.CLRJourneyTime) as...

.NET decompilation, how easy is it?

Hi, I was looking into the best encryption for a license key for an application, and someone said that someone can easily decompile the application and then just skip the test for the license key. how would someone go about doing that practically speaking? So they have my .dll, they have to decompile it somehow, then comment out the f...

How do you import CSV files with "improper" file names?

Ok, I am importing and parsing csv files in a C# app. I started out doing a simple ReadLine() and splitting on commas but it turns out some of the text fields have commas in them. So I started to roll my own splitting function. Fortunately, it was only a few minutes before the "Hey stupid, someone's probably already done this?" light c...

What's the best way to automate secure FTP in PowerShell?

I'd like to automate the FTP download of a database backup file using PowerShell. The file name includes the date so I can't just run the same FTP script every day. Is there a clean way to do this built into PowerShell or using the .Net framework? UPDATE I forgot to mention that this is a through a secure FTP session. ...

Stop System.Windows.SplashScreen with WinForms from closing the app

I'm using System.Windows.SplashScreen to add a splash screen to my WinForms app (it has a lot of WPF controls, but the 'main window' is still a System.Windows.Forms.Form object). When the splash screen closes the whole app goes as well. Can I stop it taking the whole app with it? ...

HOw to create a calendar event / appointment in Exchange Server 2003 without using Outlook ?

hi , Is there any way to create - manipulate calendar events in Exchange Server 2003 ? I'm using Vb .NET 2005. I don't want to use MAPI because everytime I will have to type user name and passwords. Is there any other way ? I used redemption.dll but everytime I want to add for eg a calendar event it displays the login screen. Any sugges...

What is the best way to parse an XML boolean attribute (in .NET)?

An XML attribute declared as xs:boolean can acceptable be "true", "false", "0" or "1". However, in .NET, Boolean.Parse() will only accept "true" or "false". If it sees a "0" or "1", it throws a "Bad Format" exception. So, given that, what's the best way to parse such a value into a Boolean? (Unfortunately, I'm limited to .NET 2.0 solu...

What is your opinion of nPersist?

It's a candidate to be used for our project so if anyone has used it any opinion will be appreciated. ...

MSV08-C#: How do I stop two groupboxes from auto-parenting themselves when dragged on top of one another?

IDE: Microsoft Visual Studio Professional 2008 Language: C# Background: I have one form and two groupboxes that are going to be used as preference catagory groupboxes. My problem is that everytime I drag one groupbox on top of the other (hide/show groupboxes upon listview catagory select), the base groupbox auto-parents the second grou...

Winforms ComboBox SelectedValueChange event

How do I prevent code from executing in the SelectedValueChange event of a combobox when the combobox is being loaded for the first time? I need the code to execute when the user has selected a new value. ...

WCF ErrorHandler

Hi, I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately, I have several doubts about how doing it. The problem is that I don't exactly understand the meaning of the two methods of IErorrHandler (i.e. ProvideFault and HandleError). For me, the HandleError is used to pro...

How do you raise a server-side event from javascript?

I have a control that is basically functioning as a client-side timer countdown control. I want to fire a server-side event when the count down has reached a certain time. Does anyone have an idea how this could be done? So, when timer counts down to 0, a server-side event is fired. ...