473,396 Members | 2,010 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.

Assembly for Client/Server AND Web

Bob
I have a C# assembly for logging messages. One option I
would like is to also display the message to the user.
It's easy if I know whether the caller is a Client/Server
app or a Web app. My question is, is there any way for my
code to determine whether the caller is a web app (and
has a page object I can use) or just a "normal" app that
I can write to the console?
If so, how would I get access to the callers current web
page object?

Thanks
Bob

Jul 21 '05 #1
2 1478
Well, you can check System.Web.HttpContext.Current property. If it is null,
then there is no current web context for this.

It then has things like the Response property, so you can Response.Write or
whatever, and all the other properties you should need.

However, if the caller is a web service, then you would sitll have a web
context, but response.write wouldn't be the way to go there.

"Bob" <bn***********@mindspring.com> wrote in message
news:08****************************@phx.gbl...
I have a C# assembly for logging messages. One option I
would like is to also display the message to the user.
It's easy if I know whether the caller is a Client/Server
app or a Web app. My question is, is there any way for my
code to determine whether the caller is a web app (and
has a page object I can use) or just a "normal" app that
I can write to the console?
If so, how would I get access to the callers current web
page object?

Thanks
Bob

Jul 21 '05 #2
Well, you can check System.Web.HttpContext.Current property. If it is null,
then there is no current web context for this.

It then has things like the Response property, so you can Response.Write or
whatever, and all the other properties you should need.

However, if the caller is a web service, then you would sitll have a web
context, but response.write wouldn't be the way to go there.

"Bob" <bn***********@mindspring.com> wrote in message
news:08****************************@phx.gbl...
I have a C# assembly for logging messages. One option I
would like is to also display the message to the user.
It's easy if I know whether the caller is a Client/Server
app or a Web app. My question is, is there any way for my
code to determine whether the caller is a web app (and
has a page object I can use) or just a "normal" app that
I can write to the console?
If so, how would I get access to the callers current web
page object?

Thanks
Bob

Jul 21 '05 #3

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

Similar topics

4
by: Frasse | last post by:
Hello all! If a client has run a program with url like this: http://server/HelloWorld.exe, then the assembly HelloWorld.exe will be cached in Assembly's Download Cache. But if then a new version...
0
by: Ken Durden | last post by:
I'm working on a client-server application where the client is controlling two devices (aka servers) which both implement the same interface contract. We have a set of about 4 assemblies which...
1
by: Kent Rollins | last post by:
I am writing a server and an MMC console app that use remoting to talk to each other. The MMC client and the server share a couple of assemblies: one has the interface that is remoted from the...
0
by: Harry N | last post by:
I am trying to implement a WORD application with Visual Studio Office Tools and C#. The application works with a WORD template installed in a server share, and creates WORD documents by filling...
2
by: Leonardo Spina | last post by:
I need to make the client (Internet Explorer) rua a class that I have defined in an assembly which obviously is placed on the server in the "bin" folder under the web root. How can I use that...
8
by: Eyeawanda Pondicherry | last post by:
I have put some code together that creates an enum dynamically from some database values. The enum can be read perfectly by an application that references the dynamically generated dll. If I...
1
by: Jim Hammond | last post by:
I can get data from a client-side assembly to the server in two manual steps, but I need to be able to do it in one step. Step 1: The user presses the manually coded "Step 1" button, which calls...
1
by: Ray | last post by:
Dear all, Now, I am using Global Assembly Cache to share assembly between server and clients. However, it seems that the server and clients use individual Global Assembly Cache. For example, the...
3
by: Leon_Amirreza | last post by:
Hi, Suppose in a scenario that security is not an issue; if I deploy a copy of the Whole assembly that contains remote objects to clients which of the following would happen? 1- The calls to...
7
by: chage | last post by:
Hi, I have been searching around to try adding reference assembly to another assembly during runtime, programatically. Is this possible in .Net? The reason for this is because i am having...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.