如何使用c#.net windows应用程序在数据库中保存和检索图标?
问题描述:
您好,
如何使用c#.net windows应用程序在数据库中保存和检索图标?
我想在运行时或使用c#.net windows应用程序更改Windows窗体图标。
这是应用程序的需要。 />
请帮帮我。
先谢谢。
Ankit Agarwal
软件工程师
Hello,
How to save and retrieve icon in database using c# .net windows application?
I want to change windows form icon at run time or using c# .net windows application.
It's a need for application.
Please help me.
Thanks in Advance.
Ankit Agarwal
Software Engineer
答
要更改图标,只需更改Icon属性即可。请参阅 Form.Icon [ ^ ]。
为了创建图标,如果您将图标数据作为流获取,则可以使用图标构造函数(流) [ ^ ]
获取流取决于如何将数据存储在数据库中,但如果您使用例如文件流,那么本文可能会帮助如何将二进制数据存储和提取到文件流列 [ ^ ]
To change the icon, you simply change the Icon property. See Form.Icon[^].
In order to create the Icon, if you get the Icon data as a stream you can utilize Icon Constructor (Stream)[^]
Getting the stream depends how you store the data in the database but if you use for example file stream, then perhaps this article would help How to store and fetch binary data into a file stream column[^]