473,387 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Verify if a DLL is used in ASP.NET application or Windows application

Hello

I have a managed class library (written in C#) that is used both in ASP.NET
and Windows applications. How can I determine which platform has been called
a class method in this library.

Thanks in advance.

Hamed
Feb 6 '07 #1
3 879
Hi,

System.Web.HttpContext.Current will return null in a non-web application.

--
Dave Sexton
http://davesexton.com/blog
http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)

"Hamed" <ha***@raymehr.comwrote in message
news:OK**************@TK2MSFTNGP06.phx.gbl...
Hello

I have a managed class library (written in C#) that is used both in
ASP.NET and Windows applications. How can I determine which platform has
been called a class method in this library.

Thanks in advance.

Hamed

Feb 6 '07 #2
Hi,
>
System.Web.HttpContext.Current will return null in a non-web
application.
True, but it will also return null if "this" call is not due to a webrequest
(for instance something run by a timer or in an extra thread)

Hans Kesting

"Hamed" <ha***@raymehr.comwrote in message
news:OK**************@TK2MSFTNGP06.phx.gbl...
>Hello

I have a managed class library (written in C#) that is used both in
ASP.NET and Windows applications. How can I determine which platform
has been called a class method in this library.

Thanks in advance.

Hamed

Feb 6 '07 #3
Hi,

True, but then dll doesn't have to process as if it is a web application -
because it's not.

--
Dave Sexton
http://davesexton.com/blog
http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)

"Hans Kesting" <ne***********@spamgourmet.comwrote in message
news:c0*************************@news.microsoft.co m...
>Hi,

System.Web.HttpContext.Current will return null in a non-web
application.

True, but it will also return null if "this" call is not due to a
webrequest
(for instance something run by a timer or in an extra thread)

Hans Kesting

>"Hamed" <ha***@raymehr.comwrote in message
news:OK**************@TK2MSFTNGP06.phx.gbl...
>>Hello

I have a managed class library (written in C#) that is used both in
ASP.NET and Windows applications. How can I determine which platform
has been called a class method in this library.

Thanks in advance.

Hamed


Feb 6 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Reader | last post by:
I have an application that allows a user to enter a user name, user password, and the domain or machine name. From this information I would like to verify the user account and password is valid. ...
1
by: Andrea Temporin | last post by:
I would like to grant access to my application with the same user of Windows. How can I verify user and password with those of the system? Now we are using LogonUser API but it works only if the...
2
by: Wayne Wengert | last post by:
I want to write a Windows application to go through all the email addresses in an SQL Server table and to report which ones are invalid. From Googling and perusing NGs it is my understanding that...
3
by: Hamed | last post by:
Hello I have a managed class library (written in C#) that is used both in ASP.NET and Windows applications. How can I determine which platform has been called a class method in this library. ...
30
by: diane | last post by:
I've got an application running with table-based security: i capture the user's windows login with fOsusername, then have them enter a password checked against their username/login in my own table....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.