How does ASP. NET differentiate the development status from the actual application status?

Source: Internet
Author: User

The development status refers to the status of running a webpage in the vs2005 environment. The actual application status refers to the status in which the user accesses the server and the service is provided by IIS.
In the development status, when debugging some pages, it was originally called by other pages, but I only need to set some sessions in page_load so that it can be set as the start page directly during debugging. However, in the actual application status, the code for setting the session cannot be run. In VB6, this code can be used to differentiate:
If getmodulehandle ("vb6.exe") = 0 then
Bruninvb6 = false
Else
Bruninvb6 = true
End if

In ASP. NET, I also use this idea to try to differentiate, and write the following code in page_load:
// If the process contains webdev. webserve and is considered to be in the development status, set this setting.
Foreach (process thisproc in process. getprocesses ())
{
// Debug. Print (thisproc. processname );
If (thisproc. processname = "webdev. webserver ")
{
// The content passed in the previous interface: session ["zggh"] And session ["fwq"]
Session ["zggh"] = "91005 ";
Session ["fwq"] = "192.168.15.13 ";
Break;
}
}

Damn it, using system. diagnostics; not added.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.