Feeds:
Posts
Comments

Posts Tagged ‘C#’

Okay, I am posting a link to this awesome example of DPAPI (Data Protection API) for C# and VB.net, mainly for my own reference. If you want to encrypt data in web.config files on shared servers, this is the way to do it. http://www.obviex.com/samples/dpapi.aspx Thanks to Julie Lerman for making me aware of DPAPI.

Read Full Post »

In my previous post on Generics, I received a comment from Eddie, who was asking why developers would want to use the following constraint, in the example below, when he would pass the parameters as IComparable interface types. public static bool IsLessThan(T one, T two) where T:IComparable { return one.CompareTo(two) < 0; } public static [...]

Read Full Post »

Oops

I forgot to mention in my last post, about Generics, that Sahil Malik helped me out with the solution. Between the two of us we figured out why parameterized constructors are not allowed when creating new instances of generic types. I would have edited my initial post, but the formatting in my blog that displays [...]

Read Full Post »

C# Generics

I’ve been playing around with generics in C# today. Simply put, generics are akin to templates in C++, only much better. My aim in this post is not to explain the in’s and out’s of generics, in the new 2.0 version of the .NET Framework but to highlight some key points of interest. For a [...]

Read Full Post »

For those of you who have never heard of the MODI acronym it stands for the Microsoft Office Document Image writer, which is a virtual printer driver for converting printed content into Microsoft Document Images or TIFF files. The idea for this virtual printer, shipped with Office, is to provide a means for converting output [...]

Read Full Post »

I kept promising myself I would write a post on how to expose a .NET assembly to COM without having to use RegASM.exe. Someone asked me today for the very code to do this, so I thought now would be as good as time as any to write my post. Microsoft provided a wonderful thing [...]

Read Full Post »

Following on from Jeff Atwood’s post about comparing a string to empty string (“”), I found out that C# and VB.net do not behave the same when comparing a string that is null. In the following C# snippet, the code will display The String is NOT Null: string s = null; if (s == “”) [...]

Read Full Post »

Jeff Atwood makes a complaint about “performance programmers” breaking his code. In his example, Jeff shows the following snippet of code: If Value <> “” Then   If nvc.Item(name) = “” Then     nvc.Add(name, Value)   End If End If … which was then changed to by the performance programmer.: If Value <> String.Empty Then [...]

Read Full Post »

Object References in C#

I have been working with some code written by other developers and it appears that there is some confusion with using the ref prefix on object parameters passed to a function. The following example illustrates some of the code I came across: using System;   namespace foo {       internal class MyClass       {             private int _x [...]

Read Full Post »

Free POP3 Client for C#

Announcing FreePOP3 …. http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=2331c59d-e726-4197-b28f-ba17845153d4 I’ve not had the chance to try this out yet but I plan to. Hopefully it has the feature of leaving messages on the server. Ideally I’d like an IMAP client, but POP3 will work for what I need for now. Anyone know of a free IMAP client for .NET?  

Read Full Post »

« Newer Posts

Follow

Get every new post delivered to your Inbox.