Friday, October 27, 2006

System.Runtime.Remoting.Channels.Ipc

hi

This is a new namespace introduced from CLR 2.0.

How can you use this ? This namespace can be used when your client and the Remotable components are present in the same machine.

IPC stands for interprocess communications in the same windows OS.

.Net 1.1 had only TCP channel--which means the remotable components were using TCP channel for remoting , but from .Net 2.0 we have the option of deciding between IPC or TCP..

So according to your remoting requirements and if you use .Net 2.0 you can use IPC communications.

Thanks
Senthil

Thursday, October 26, 2006

Partial Classes???

Partial Classes, what are they ? are they New ?

Yes CLR2.0 provides the new concept of Partial class---- A single class can be split in to many classes in same name , but with the indicator partial.

Partial classes are a new feature to the .NET Framework 2.0 and again C# takes advantage of this addition.
Partial classes allow you to divide up a single class into multiple class files, which are later combined into a single class when compiled.
To create a partial class, you simply need to use the partial keyword for any classes that are to be joined together with a different class.
The partial keyword precedes the class keyword for the classes that are to be combined with the original class.

For instance, you might have a simple class called Calculator as shown here:

public class Calculator{

public int Add(int a, int b) {
return a + b;
}
}
From here, you can create a second class that attaches itself to this first class as shown here in the following example:

public partial class Calculator{

public int Subtract(int a, int b) {

return a - b;

}
}
When compiled, these classes will be brought together into a single Calculator class instance as if they were built together to begin with.

Tuesday, October 17, 2006

Windows Service in VS2005 ??

Had you ever stuck up in creating windows Service in vs2005 ??
Like any other Person , you must have also wondered why the template for creating Windows Service is absent in VS2005.
I was also the one.
But after some research i found that , VS2005 is not provided with the Template for creating windows service in VS2005.
In order to create a Windows Service in VS2005 , follow the Below steps:
1. Create an empty project.
2. Save the project.
3. Add system.ServiceProess and System.Configuration.Install Dll references.
4.Now you need to add 2 class files to ur project.
5.windowsServcie.cs and windowsServiceInstaller.cs
6.Add the below code using statement to windowsService.cs:
using System.Diagnostics;using System.ServiceProcess;
namespace WindowsService{ class WindowsService : ServiceBase { }
7. add the below using statements code to windowsserviceinstaller.cs:
using System;
using System.ComponentModel;using System.Configuration.Install;using System.ServiceProcess;
namespace WindowsService{ [RunInstaller(true)] public class WindowsServiceInstaller : Installer { /// /// Public Constructor for WindowsServiceInstaller. /// - Put all of your Initialization code here. /// public WindowsServiceInstaller() { } }

8. Now add all the code as like VS2003 , which u like to add for the windows service.

Thanks
Senthil