Simplest Way is to save the images icon of all the possible file types in some folder like "icons" and based on the extension you can use the particular image on the particular file. You can get icon images anywhere on Google.
e.g
<img id="imgIcon" runat="server"></img>
string myFilePath = @"C:\MyFile.txt";
string ext = Path.GetExtension(myFilePath);
if(ext=="txt")
{
imgIcon.Src="icon/txtIcon.jpg";
}
else if(ext=="doc" || ext=="docx")
{
imgIcon.Src="icon/wordIcon.jpg";
}