• Home
  • About
  • Streaming

xneuron

eXtreme Neuron

Feeds:
Posts
Comments

File MIME Type Using C#

February 23, 2009 by bnma

string fileName = “C:\\somefile.vsd”;
string mimeType = “application/unknown”;
string ext = System.IO.Path.GetExtension(fileName).ToLower();
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext);
if (regKey != null && regKey.GetValue(“Content Type”) != null)
{
mimeType = regKey.GetValue(“Content Type”).ToString();
}

Posted in .Net, C#, Windows | No Comments Yet

  • Pages

    • About
    • Streaming
  • c

  • Top Posts

    • Copy Directory And Its Content To Another Directory In C#
    • String.Format() In JavaScript As In C#
    • Convert an ArrayList of strings to a string[] array
    • Deserialize XML string
    • X509 Certificate Installation
    • Move Items From One ListBox To Another
    • Page Postbacks And Client Callbacks
    • Launch Cassini Using Command Line
    • File MIME Type Using C#
    • Filtering Non-Numeric Characters In A Textbox Using Javascript
  • Recent Posts

    • Url Validation In Javascript
    • Script To Search Text In Database
    • Launch Cassini Using Command Line
    • Max File Size Upload In ASP.Net
    • File MIME Type Using C#
  • Archives

    • June 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • October 2008
    • August 2008
    • May 2008
    • April 2008
    • February 2008
    • December 2007
    • October 2007
    • September 2007
    • April 2007
    • January 2007
    • November 2006
    • October 2006
    • September 2006
  • Blog Stats

    • 69,059 hits
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.com
  • Watch videos at Vodpod and other videos from this collection.

Blog at WordPress.com.

Theme: Mistylook by Sadish.