Blog
157   0

Add Text File in Resource and Access it in Windows Form Application

By Yogesh Sharma Blogs | Visual Studio 2010 Oct 03, 2012
In this code add a text file to Resource then we show this text file any where without externally copy this text file.

In this code add a text file to Resource then we show this text file in any where without externally copy this text file. 

private void button1_Click(object sender, EventArgs e)
{
    char[] byteArray = new char[showHelp.Properties.Resources.build_relation.Length];
    showHelp.Properties.Resources.build_relation.CopyTo(0,byteArray, 0,byteArray.Count());
    string tmpPath= Path.GetTempPath();
    StreamWriter sw = new StreamWriter(tmpPath + "\\help.txt");
    sw.Write(byteArray);
    sw.Close();
    System.Diagnostics.Process.Start(tmpPath + "\\help.txt");
}

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs