Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

read embedded resource c# xml

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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #embedded #resource #xml
ADD COMMENT
Topic
Name
8+8 =