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

Wednesday, May 10, 2006

How to recover a deleted folder (shift+delete) from Outlook InBox.
246153 XCLN: How to Recover Items That Have Been Hard Deleted
http://support.microsoft.com/?id=246153
I guess this is set by default with OL2003. If deleted items are not being preserved on the Exchange server, you've got nothing.

I’ve written a media player and need to copy the window while in pause mode. 6 pack of fav beverage for solution.
Google is full of Pinvoke ([DllImport) samples, I’d prefer a GDI+ .net solution.
If you are using CLR 2.0, you can avoid PInvoke by using the Graphics::CopyFromScreen method.
http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.copyfromscreen.aspx

When using terminal services client to connect to a server, how can you change the background?
On the machine with TS, go into TS Configuration, select Server Settings and Enable Active Desktop

I want users to download my content to their client computer rather than simply viewing it in the browser. But how do you override the browser's determination to render known MIME types itself?
Suppose you've written an ASP page that contains a link to a known MIME type, but you want the user to download the file instead of viewing it. Add the following to your script:
response.addHeader "content-disposition", "attachment;filename=filename.ext"
Then substitute the actual filename and extension, and it's as good as done.