How to get the associated icon from a network share file

后端 未结 5 1438
深忆病人
深忆病人 2020-12-07 00:21

I am using Icon.ExtractAssociatedIcon to get the icon of a file , that a user selects, in an openfiledialog.

THe problem is if the user selects an icon from a netw

5条回答
  •  北海茫月
    2020-12-07 01:10

    One method to accomplish this is to retrieve your UNC path and temporarily map it to a drive letter, then use that drive in your .ExtractAssociatedIcon method. When you have retrieved the icon, you can unmap the drive. It's not elegant, but it should work just fine.

提交回复
热议问题