English 中文(简体)
• 如何在伙伴关系中使用ole产品。 NET 环境
原标题:How to use console output in an ASP.NET environment?

我想在请求处理过程中印出一些痕迹。

但是,当我让科索尔时。 这一环境中的写作(“隐形”)没有显示。

什么是失踪的,我需要做些什么才能用奥尼特语印刷这些痕迹?

最佳回答

使用<代码>Debug.Write(),并观察通过民主选举学会的夸大产出窗口取得的成果。

或者,使用特征,该特征是相当强大的。 一旦你能够进行追踪,你就能够追踪。 页: 1 该网页将显示你的照片。

问题回答

除了已经提到的方法外,你可以简单地写到一个记录档案中:

File.AppendAllText(@"c:log.txt", @"Debug Message Here!" + Environment.NewLine);

当然,你可以使用服务器。 页: 1

我知道这一点很晚,但你可以使用以下类别从你的C#稿中写到 Java稿。

public static class Javascript
{
    static string scriptTag = "<script type="" language="">{0}</script>";
    public static void ConsoleLog(string message)
    {       
        string function = "console.log( {0} );";
        string log = string.Format(GenerateCodeFromFunction(function), message);
        HttpContext.Current.Response.Write(log);
    }

    public static void Alert(string message)
    {
        string function = "alert( {0} );";
        string log = string.Format(GenerateCodeFromFunction(function), message);
        HttpContext.Current.Response.Write(log);
    }

    static string GenerateCodeFromFunction(string function)
    {
        return string.Format(scriptTag, function);
    }
}

这样,你就可以在你点击现场时,如你会 j的时候,实时看到你的标识。

你们可以做出反应。 撰写论文,将产出写到你的网页,以便进行清点,或用javascript进行警示,或甚至写到记录上。 获取分解产出的方法很多。 还有一个标志。 您可使用的净值(类似于原4j)

你们在什么地方寻找产出?

Console。 书写字在指挥线上,而不是在网页上。 两种使用对应办法。 撰写文章,在网页上书写或开始在视力演播室台上应用,以检查指挥线的产出。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签