Extract Icon from Executable
I am trying to extract the associated icon from .exe files
I found some code for Vb.Net that looks like it should work, but I need it in C#.  I tried converting it, but I really need it in C#.  Here is what I found for VB.Net ([Link][1])
When I convert it, C# doesn't recognize the "IconFromFile" that is in the VB.Net (Am I just missing a reference?)  


    Imports System.Drawing
    Module Module1
    
        Sub Main()    
            Dim filePath As String =  "C:\myfile.exe"  
            Dim TheIcon As Icon = **IconFromFile**(filePath)  
    
            If TheIcon IsNot Nothing Then    
                ''#Save it to disk, or do whatever you want with it.
                Using stream As New System.IO.FileStream("c:\myfile.ico", IO.FileMode.CreateNew)
                    TheIcon.Save(stream)          
                End Using
            End If
        End Sub
    
        Public Function IconFromFilePath(filePath As String) As Icon
            Dim result As Icon = Nothing
            Try
                result = Icon.ExtractAssociatedIcon(filePath)
            Catch ''# swallow and return nothing. You could supply a default Icon here as well
            End Try
            Return result
        End Function
    End Module


  [1]: http://stackoverflow.com/questions/462270/get-file-icon-used-by-shell
Extract Icon from Executable
===

I am trying to extract the associated icon from .exe files
I found some code for Vb.Net that looks like it should work, but I need it in C#.  I tried converting it, but I really need it in C#.  Here is what I found for VB.Net ([Link][1])
When I convert it, C# doesn't recognize the "IconFromFile" that is in the VB.Net (Am I just missing a reference?)  


    Imports System.Drawing
    Module Module1
    
        Sub Main()    
            Dim filePath As String =  "C:\myfile.exe"  
            Dim TheIcon As Icon = **IconFromFile**(filePath)  
    
            If TheIcon IsNot Nothing Then    
                ''#Save it to disk, or do whatever you want with it.
                Using stream As New System.IO.FileStream("c:\myfile.ico", IO.FileMode.CreateNew)
                    TheIcon.Save(stream)          
                End Using
            End If
        End Sub
    
        Public Function IconFromFilePath(filePath As String) As Icon
            Dim result As Icon = Nothing
            Try
                result = Icon.ExtractAssociatedIcon(filePath)
            Catch ''# swallow and return nothing. You could supply a default Icon here as well
            End Try
            Return result
        End Function
    End Module


  [1]: http://stackoverflow.com/questions/462270/get-file-icon-used-by-shell