how to load file from resources in c#
string s = GetEmbeddedResource("SociometryTree", "Notes.txt");
how to load file from resources in c#
string s = GetEmbeddedResource("SociometryTree", "Notes.txt");
how to load file from resources in c#
// required
using System.IO;
using System.Reflection;
public string GetEmbeddedResource(string namespacename, string filename)
{
var assembly = Assembly.GetExecutingAssembly();
var resourceName = namespacename + "." + filename;
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
return result;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us