C
Cleber Schönhofen
Hi,
How i can pass webpage objects, like Server and Request, to another
class.
-------------
Page :
public partial class w_indice : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
libFunc.gravaLog("Test ");
}
}
Class :
namespace libFunctions {
public class libFunc : System.Web.UI.Page {
public libFunc() {
}
public void gravaLog(string msg)
{
// Escreve no arquivo de log
StreamWriter sw = File.AppendText(Server.MapPath("~/appWeb.log"));
sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + " : "
+ msg);
sw.Close();
}
}
}
How i can pass webpage objects, like Server and Request, to another
class.
-------------
Page :
public partial class w_indice : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
libFunc.gravaLog("Test ");
}
}
Class :
namespace libFunctions {
public class libFunc : System.Web.UI.Page {
public libFunc() {
}
public void gravaLog(string msg)
{
// Escreve no arquivo de log
StreamWriter sw = File.AppendText(Server.MapPath("~/appWeb.log"));
sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + " : "
+ msg);
sw.Close();
}
}
}