DCSIMG
January 2009 - Posts - Rotem Bloom's Blog

Rotem Bloom's Blog

Share knowledge on .NET and web development

News

About Me

Glad to help and share knowledge on .NET and also huge fan of Dream Theater.

Contact me via messenger

View Rotem Bloom's profile on LinkedIn

Dream Theater Pics

Blogs I Read

January 2009 - Posts

Browser and Operating System Detection In ASP.NET

Hi,

Detect user Browser and Operating System version in ASP.NET is very simple using the C# code:

Request.Browser

This code retuns the HttpBrowserCapabilities class that has the information we desire.

Unfortunately the default Browser Caps configuration that come with ASP.NET 2.0 does not include browsers like Google Chrome and I could not find a way of getting the operating system version.

Finally I came up with solution that solve my problem as describe below:

  • On my ASP.NET application I open new ASP.NET folder: App_Browsers.
  • I download updated *.browser files that contain the information on the Google Chrome browser and also the operating system version and copy them to the App_Browsers folder. You can get the updated files from here.

I also attach small ASP.NET project that explain the solution. You can download it from here.

Enjoy Rotem :-)

TreeSize Free - Tells you where precious space has gone to

Hi All,

I use a nice tool that helps me figure out which folders holds the most disk space on my computer. The tool called TreeSize Free and it highly recommended.

Description: 

Every hard disk is too small if you just wait long enough. TreeSize Free tells you where precious space has gone to. TreeSize Free can be started from the context menu of a folder or drive and shows you the size of this folder, including its subfolders. You can expand this folder in Explorer-like style and you will see the size of every subfolder. Scanning is done in a thread, so you can already see results while TreeSize Free is working. The space, which is wasted by the file system, can be displayed and the results can be printed in a report. TreeSize Free is freeware for Windows 2000/XP/Vista.

Screen shot:

TreeSize Free

Visual Source Safe Tip: Open VSS 2005 client without enter user name and password

Hi,
If you want to set VSS (Visual Source Safe) 2005 client default user name and password without type them all the time, you have to do the following steps:
1) right click on VSS 2005 client icon
2) select properties
3) on the "target" at the end add your desire user name and pssword as follow:
-Y,
So you target shuold look like something like:
"C:\Program Files\Microsoft Visual SourceSafe\ssexp.exe" -YMyUser,123456.

This will open your source safe client with current user without opening the user password screen.

Silverlight toolkit: An unknown error occurred running Code Analysis. Please contact Microsoft Product Support Services.

Hi,

I download the Silverlight Toolkit include source code from codeplex. I Open Silverlight.Controls.sln and try to compile it.

I got error saying: "An unknown error occurred running Code Analysis. Please contact Microsoft Product Support Services."

I'm using VS Team System 2008 SP1 with .NET 3.5 SP1.

In order to solve this error I need to go for each Silverlight Project and remove the "Enable Code Analysis on Build" check box. Very irritating don't you think??!!!!

Well I found better solution:

I download the latest FxCop version (1.36) from here and install it on the directory VS 2008 use the FxCop.

On my machine the location was under: C:\Program Files\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop

This solve my problem without changing each project "Enable Code Analysis on Build" checkbox.

 I Hope it will help you also Bye Rotem.

Open Multiple Visio Instances (open different visio windows in taskbar)

Hi,

Open multiple Visio documents is possible, but the default Visio behavior is to open multiple document on the sane Visio instance. In order to view each document you need to go to "Windows" toolbar and switch between the Visio documents.

You can change this behavior by simply update the Visio registry key: SingleInstanceFileOpen.

First open Visio and select Tool --> Option --> Advanced and check "Put all settings in Windows Registry".

For Office 2007 the key locate under:

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Visio\Application\SingleInstanceFileOpen

Update the value from 1 to 0.

Now each Visio document will open in different Visio instance.

Amazing Free Uninstaller Application

Hi All,

There is an excellent free Uninstaller Application Revo Uninstaller.

Revo Uninstaller helps you to uninstall software and remove unwanted programs installed on your computer even if you have problems uninstalling and cannot uninstall them from "Windows Add or Remove Programs" control panel applet.

Revo Uninstaller is a much faster and more powerful alternative to "Windows Add or Remove Programs" applet!