• 大小: 0.03M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: 图标  C#  

资源简介

c#通过系统API获取EXE或dll中集成的图标

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace IconTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btn_AddFile_Click(object sender EventArgs e)
        {
            OpenFileDialog dlgOpenFile = new OpenFileDialog();
            if (dlgOpenFile.ShowDialog() == DialogResult.OK)
            {
                IntPtr hIcon = Iconhelp.GetJumboIcon(Iconhelp.GetIconIndex(dlgOpenFile.FileName));
                System.Drawing.Icon fileIcon = (Icon)System.Drawing.Icon.FromHandle(hIcon).Clone();
                this.pictureBox1

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      13312  2016-08-14 22:05  IconTest\IconTest\bin\Debug\IconTest.exe

     文件      26112  2016-08-14 22:05  IconTest\IconTest\bin\Debug\IconTest.pdb

     文件      11600  2016-08-14 22:05  IconTest\IconTest\bin\Debug\IconTest.vshost.exe

     文件        490  2014-01-13 21:31  IconTest\IconTest\bin\Debug\IconTest.vshost.exe.manifest

     文件        904  2016-08-14 22:05  IconTest\IconTest\Form1.cs

     文件       2875  2016-08-14 22:05  IconTest\IconTest\Form1.Designer.cs

     文件       5817  2016-08-14 22:05  IconTest\IconTest\Form1.resx

     文件       8730  2016-08-14 21:59  IconTest\IconTest\Iconhelp.cs

     文件       3763  2016-08-14 22:04  IconTest\IconTest\IconTest.csproj

     文件        489  2016-08-14 21:55  IconTest\IconTest\Program.cs

     文件       1366  2016-08-14 21:55  IconTest\IconTest\Properties\AssemblyInfo.cs

     文件       2868  2016-08-14 21:55  IconTest\IconTest\Properties\Resources.Designer.cs

     文件       5612  2016-08-14 21:55  IconTest\IconTest\Properties\Resources.resx

     文件       1095  2016-08-14 21:55  IconTest\IconTest\Properties\Settings.Designer.cs

     文件        249  2016-08-14 21:55  IconTest\IconTest\Properties\Settings.settings

     文件        866  2016-08-14 21:55  IconTest\IconTest.sln

    ..A..H.     43520  2016-08-14 22:05  IconTest\IconTest.suo

     目录          0  2016-08-14 22:04  IconTest\IconTest\bin\Debug

     目录          0  2016-08-14 21:55  IconTest\IconTest\bin

     目录          0  2016-08-14 21:55  IconTest\IconTest\Properties

     目录          0  2016-08-14 22:06  IconTest\IconTest

     目录          0  2016-08-14 21:55  IconTest

----------- ---------  ---------- -----  ----

               129668                    22


评论

共有 条评论