small DiGiTaL world
مجرد تدوينات صغيرة في العصر الرقمي
Skip to content
  • ليبيا
    • الدستور الأمريكي
    • دستور 1963
    • دستور 2011 المؤقت
    • أعضاء المؤتمر الوطني العام
    • مجلس النواب 2014
    • حكومة علي زيدان وعبد الله الثني
  • برمجة
  • أفلام
  • المدون
  • راسلني
  • شركة القمة
← الرابحون في انتخابات لجنة الستين
Dell Venue Pro loses wireless connection after installing Windows Updates →

How to read embedded resource text file

Posted on 2014/03/01 by Tarek Siala

source_code_visual_basic

You can use the Assembly.GetManifestResourceStream Method:

var assembly = Assembly.GetExecutingAssembly();
var resourceName = "MyCompany.MyProduct.MyFile.txt";

using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
    string result = reader.ReadToEnd();
}

Source

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Google+ (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to print (Opens in new window)

Like this:

Like Loading...

Related

تدوينات شبيهة

  1. SmartPaste for VS2008.NET
  2. Future Directions for C# and Visual Basic
  3. CodeRush Express
  4. C# : How Send E-Mail
This entry was posted in Developer, Programming and tagged C#. Bookmark the permalink.
← الرابحون في انتخابات لجنة الستين
Dell Venue Pro loses wireless connection after installing Windows Updates →

التعليقات مغلقة

  • View my Flipboard Magazine.
small DiGiTaL world
Web design by paomedia.
%d bloggers like this: