ASP.NET 2.0, how to have server resource?

L

Lloyd Dupont

I'm creating a web site and I store some SQL script in .SQL file.
Now I would like to read this file.

In an ordinary (desktop) application, I'm used to simply embed them in the assembly and get a stream to them with:
string GetEmbededText(string name)
{
Type t = GetType();
using (Stream s = t.Assembly.GetManifestResourceStream(t, name))
return new StreamReader(s).ReadToEnd();
}

How could I achieve similar result in ASP.NET?
 
L

Lloyd Dupont

I just end up putting my file in ~/App_GlobaResources

I'm creating a web site and I store some SQL script in .SQL file.
Now I would like to read this file.

In an ordinary (desktop) application, I'm used to simply embed them in the assembly and get a stream to them with:
string GetEmbededText(string name)
{
Type t = GetType();
using (Stream s = t.Assembly.GetManifestResourceStream(t, name))
return new StreamReader(s).ReadToEnd();
}

How could I achieve similar result in ASP.NET?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top