ASP.NET 2.0, how to have server resource?

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
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?
 
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?
 
Back
Top