How to read embedded resource text file

前端 未结 22 2332
悲&欢浪女
悲&欢浪女 2020-11-21 06:03

How do I read an embedded resource (text file) using StreamReader and return it as a string? My current script uses a Windows form and textbox that allows the

22条回答
  •  野的像风
    2020-11-21 06:56

    Something I learned just now is that your file is not allowed to have a "." (dot) in the filename.

    A

    Templates.plainEmailBodyTemplate-en.txt --> Works!!!
    Templates.plainEmailBodyTemplate.en.txt --> doesn't work via GetManifestResourceStream()

    Probably because the framework gets confused over namespaces vs filename...

提交回复
热议问题