473,396 Members | 2,099 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,396 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 1099
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.