Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

Attaching an Event Handler

Whenever I need to attach an event handler, usually I use one of these methods, a delegate, anonymous method, or lambda expression. For complex events (more than 3 lines of code), I create a separate method. If the method is short, I use anonymous method.
Posted by HelloWorld | 0 Comments
Filed under:

How to Give Authenticated Users or Everyone Access to Your Share Programmatically

Another follow-up from my previous article, Programmatically Configuring Permissions on a Share , David B asked a question, how to share a folder to Everyone, instead of to a specific users. This article will answer that question, based on the code on
Posted by HelloWorld | 0 Comments

How to Programmatically Modify the IIS Virtual Directory

If you have more than a dozen web servers in a cluster with identical setting, and you need to update the virtual directory, it is much more convenient to write a simple program to update it. This example shows how to do it. In this case, this snippet

Concatenating A List of Elements into A String, From [A] [B] [C] into "A, B, C"

This is a quite common problem, there is a list of strings, and you need to concatenate them with a delimiter, let says a comma. There are several different approaches to this problem. Before .Net era, I use for loop, and check if the loop counter is
Posted by HelloWorld | 2 Comments

Generating P/Invoke Signature

I have been using PInvoke.Net for long time. I discovered a tool, P/Invoke Interop Assistant. It is very cool. Not only it can gives you the managed wrapper around the native Windows API, it also gives you the ability to generate the unmanaged signature
Posted by HelloWorld | 2 Comments

Workaround to deserialize ‘True’, ‘False’ using XmlSerializer

This is the scenario, system A is taking an xml from system B. System A will deserialize the xml into an object. Unfortunately, a dev in system B decides that System.Xml namespace is evil and construct the xml using StringBuilder. In one of the element,
Posted by HelloWorld | 0 Comments

C# 3.0 Automatic Property

C# introduces a number of syntactic sugar, including Automatic Property link . A question was asked, why is this useful, what is the advantage of this approach compared to exposing the field as public field? The advantage of the automatic property is
Posted by HelloWorld | 10 Comments

How to Add Command Line Support with Your .MSI

One of the requirements in building setups was to allow the Operations team to execute the .msi file from the command line. GUI is not for expert! :) If you are familiar with Visual Studio setup, each of the UI element has a property, and you pass this
Posted by HelloWorld | 3 Comments

Fixing the Issue that Does Not Exist

I spent some time planning on improvements that I wanted to do on one of our project. I reviewed the code that I notice a place where I think I could improve the performance by avoiding locking. So I wrote the code, and tested it, works great, the new

IE 8 RC 1 is Now Available for Download

I downloaded and installed IE 8 RC 1 on my machine. It works really well, the performance improvement is significant. I would encourage you to give it a try, http://www.microsoft.com/windows/internet-explorer/beta/worldwide-sites.aspx . Disclaimer, this
Posted by HelloWorld | 0 Comments
Filed under:

Writing Fast Code (Resources)

This article is intended to help me remember where can I find these resources, also kind of helpful should I need to forward this to someone. Hopefully, this post will be continuously updated. Managed code is very fast in allocating memory, the problem

It Is 2009, Happy New Year!!!

Happy New Year, everyone. Wish you all the best this year.
Posted by HelloWorld | 3 Comments

When Building Multi-Threaded Applications using ThreadPool, Make the Number of Worker Threads Configurable

Just a simple thought, when creating a multi-threaded applications, make the number of threads configurable. ThreadPool has this behavior that it will immediately set the minimum worker threads equal to the number of logical processors in your machine,

String.Split has High Cost on Performance

One application had a memory issue, it just consume too much resources. The application performed well, but it is very obvious when we saw the performance counters, something can be done to make it better. Reviewing the code did not reveal something significant,
Posted by HelloWorld | 0 Comments

How to Create Custom Event Log for Windows Service

When you created a Windows Service, you usually add a Service Installer to allow this service to be installed using InstallUtil or installing it programmatically like this post shows you. The service installer will create the Event Log for the service,
More Posts Next page »
 
Page view tracker