怎么获取应用程序图标 搜了很多试了很久,获取到的总是这个图标求个有用的获取应用程序图标的代码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://topic.csdn.net/u/20100728/16/d7d96617-645a-4c12-9ed9-8424a0e5b232.html this.Icon = Icon.ExtractAssociatedIcon(@"C:\Program Files\mozilla firefox\firefox.exe");这个简单,直接获取了~~[align=center]****************************** 本内容使用CSDN 小秘书回复 ** 每天回帖即可得10分可用分! ******************************[/align] 2L,你那个试过还是获取不到,后来在百度找到篇,已经解决了,给大家看下 [System.Runtime.InteropServices.DllImport("shell32.dll")] private static extern int ExtractIconEx(string lpszFile, int niconIndex, ref IntPtr phiconLarge, ref IntPtr phiconSmall, int nIcons); public void getico(string l, PictureBox o) { if (l != "") { IntPtr Large, Small; int nIcons; Large = (IntPtr)0; Small = (IntPtr)0; nIcons = ExtractIconEx(l, -1, ref Large, ref Small, 1); ExtractIconEx(l, 0, ref Large, ref Small, 1); o.Image = Icon.FromHandle(Large).ToBitmap(); } }private void button1_Click(object sender, EventArgs e) { string x = @"路径"; getico(x, pictureBox1); } 省市级联???急死人啊!! 做一个类似飞信或者QQ好友列表,求高手指点一二,不甚感激 CustomErrorPage配置错误 线程中如何将数据写入窗体中的文本框? C#中如何将string转化为string[] vs对窗体大小的限制问题 NG.Net.Mail中有没有某个类可以读取本地eml邮件文件,并解析。高分跪求。 asp.net中怎样用querystring传递2个字段 导出Excel异常 一个小问题,大家来看下 RSACryptoServiceProvider对xml加密解密的问题 datagrid问题
这个简单,直接获取了~~[align=center]*****************************
* 本内容使用CSDN 小秘书回复 *
* 每天回帖即可得10分可用分! *
*****************************[/align]
private static extern int ExtractIconEx(string lpszFile, int niconIndex, ref IntPtr phiconLarge, ref IntPtr phiconSmall, int nIcons); public void getico(string l, PictureBox o)
{
if (l != "")
{
IntPtr Large, Small;
int nIcons;
Large = (IntPtr)0;
Small = (IntPtr)0;
nIcons = ExtractIconEx(l, -1, ref Large, ref Small, 1);
ExtractIconEx(l, 0, ref Large, ref Small, 1);
o.Image = Icon.FromHandle(Large).ToBitmap();
}
}private void button1_Click(object sender, EventArgs e)
{
string x = @"路径";
getico(x, pictureBox1);
}