code.club

 找回密碼
 立即註冊
搜索
查看: 448|回復: 0
打印 上一主題 下一主題

目前(net 8.0) C#從後台插入圖片與取用的方法

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2024-3-11 09:02:21 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
目前(net 8.0) C#從後台插入圖片與取用的方法:
先點solutions的名稱,按右鍵,找它的Properties點右鍵,會出現一堆Appllication, Global Usings,Build....Resources, Settings。此時點Resources,會出現General項目,下方有 Create or open assembly resources,點進去之後,左上方可選Images, String....的資源即可。
在後台程式碼要取用這邊加入的圖檔例如123.jpg,程式碼如下:
p.Image = (Image)Properties.Resources.ResourceManager.GetObject("123");
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|手機版|Archiver|code.club  

GMT+8, 2024-4-27 19:53 , Processed in 0.084724 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表