📜  读取嵌入式资源 c# xml - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:23.810000             🧑  作者: Mango

代码示例1
public string GetResourceTextFile(string filename)
{
    string result = string.Empty;

    using (Stream stream = this.GetType().Assembly.
               GetManifestResourceStream("assembly.folder."+filename))
    {
        using (StreamReader sr = new StreamReader(stream))
        {
            result = sr.ReadToEnd();
        }
    }
    return result;
}