//usage: string s = CopyResourceToTempFile(GetType(), 'showcase.txt');
//where showcase.txt is an embedded resource
static string CopyResourceToTempFile(Type type, string name)
{
string temp = '';
string nsdot = type.Namespace;
if (nsdot == null)
nsdot = '';
else if (nsdot != '')
nsdot += '.';
Stream stream = type.Module.Assembly.GetManifestResourceStream(nsdot + name);
if (stream != null)
{
StreamReader sr = new StreamReader(stream);
temp = Path.GetTempFileName();
StreamWriter sw = new StreamWriter(temp, false);
sw.Write(sr.ReadToEnd());
sw.Flush();
sw.Close();
}
return temp;
}
WHY WE STAND OUT
- Blazor Competitive Upgrade
- Angular Competitive Upgrade
- JavaScript Competitive Upgrade
- React Competitive Upgrade
- Vue Competitive Upgrade
- Xamarin Competitive Upgrade
- WinForms Competitive Upgrade
- WPF Competitive Upgrade
- PDF Competitive Upgrade
- Word Competitive Upgrade
- Excel Competitive Upgrade
- PPT Competitive Upgrade
CONTACT US
- Fax: +1 919.573.0306
- US: +1 919.481.1974
- UK: +44 20 7084 6215
Toll Free (USA):
- 1-888-9DOTNET
- sales@syncfusion.com
Share with