调用 Properties.Resources 全域资源档

有时候难免要使用一些资源档
步骤分为 新增 & 使用

新增
在方案总管的专案上右键 选属性
https://ithelp.ithome.com.tw/upload/images/20210223/20129372POJO11XX0s.png

再选资源
https://ithelp.ithome.com.tw/upload/images/20210223/20129372LiI2yHbopX.png

加入资源 我准备的是纯文字的TXT档
https://ithelp.ithome.com.tw/upload/images/20210223/20129372XQ9u29FryF.png

加好後 自动产生一个名为Resources的资料夹
https://ithelp.ithome.com.tw/upload/images/20210223/20129372ek9AuFy9RA.png


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Resources_test_2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(Properties.Resources.GN25L96_A2_table2);
            Console.ReadLine();
        }
    }
}

结果如下
https://ithelp.ithome.com.tw/upload/images/20210223/20129372FhlNW6JSn7.png

结案

好像没有用到 using System.Resources; 我也不知道为什麽


<<:  六顶思考帽子的作用是什麽?

>>:  Golang-gRPC & Protocol Buffers

Day17 - this&Object Prototypes Ch3 Objects - Iteration 开头

var myArr = ['燃面', '生菜', '花椒']; myArr.a = '雉鸡'; //...

从 IT 技术面细说 Search Console 的 27 组数字 KPI (24) :检索统计报表 KPI 外的重点项目

在去年的 2021–11–25 那天,Google 终於把 Search Console 的检索统计...

Material UI in React [ Day12 ] Inputs (Select) 选择框

今天要讲解的是 Select 组件,官网文件连结在这里。 Select 其实跟原生 html 里的 ...

数位 AI 新时代

人的科技文明发展始终来自於人性 在数位的新时代浪潮席卷之下,世界各国不论是个人的发展,还是组织企业团...

Day19 探讨setting(1)

不晓得大家还记不记得我在Day06的时候有跟大家大概介绍过Project创建完後的档案,还记得里面有...