Wednesday, May 24, 2006

The documentation says to use the “Tools/Code Snippet Manager”. But I don’t have a Code Snippet Manager in my VS2005 IDE?
On the Tools menu, click Import ant Export Settings
Select Reset all settings
Click Next, Select Yes or No on the next page according to your preference
Click Next, Select Visual C# Development Settings
Click Finish

I want all the files located in a folder (folder name known & names of the files not known) to be copied to another location?
DirectoryInfo di = new DirectoryInfo(“foldername_with_complete_path”);
FileInfo[] fiList = di.GetFiles();
foreach(FileInfo fi in fiList)
{
File.Copy(fi, “NewDirName” + “\\” + fi.Name);
}


One of my services I am developing is depending on WMI. I am using WMI notifications and hardware enumeration. When my computer gets restarted my service loads up in a wrong order. It seems like my service is started before the WMI Service. Does anyone know how I can control the load order of my service?
Look into "ServiceInstaller.ServicesDependedOn" option at
http://msdn2.microsoft.com/en-us/system.serviceprocess.serviceinstaller.servicesdependedon.aspx

No comments: