Possible Duplicate:
How to read embedded resource text file
I try to create a simple application which reads out from a "resource" file, which I've already add into my solution. I've tried this, but this doesn't work:
static void Main(string[] args)
{
StreamResourceInfo streamResourceInfo = Application.GetContentStream(new Uri("pack://application:,,,/myfile.txt", UriKind.Absolute));
StreamReader sr = new StreamReader(streamResourceInfo.Stream);
var content = sr.ReadToEnd();
Console.WriteLine(content);
}
It says: "Invalid URI: Invalid port specified."
How can I solve this?