use/reuse of intranet business dlls by asp.net apps

G

Guest

We want to use allready written C sharp programs for our asp.net
applications. The idea is that we write a program ONCE and use this same
EXACT logic for our internet apps. Everything will run on the same server but
we will have two types of clients 1. web based, 2. intranet based. Is this
possible? If so, what is it called in Microsoft speak? How to links would be
appreciated.
 
A

Alexey Smirnov

We want to use allready written C sharp programs for our asp.net
applications. The idea is that we write a program ONCE and use this same
EXACT logic for our internet apps. Everything will run on the same server but
we will have two types of clients 1. web based, 2. intranet based. Is this
possible? If so, what is it called in Microsoft speak? How to links would be
appreciated.

You can identify the type of user by IP address, for example, if an
address starting with 10.*, it's an internal network IP.

if (Request.ServerVariables ["REMOTE_ADDR"].indexOf("10.") == 0) {
.....
 
A

Aidy

Look into "remoting" or "web services" as two possible solutions. Maybe web
services would be the better solution. You expose your code via web methods
and both the website and applications use the web service.
 
G

Guest

I do not want to reprogram. I want to use existing C#
Objekts/methods/programs in my internet app.
--
cheers,
nuutuudnet


Alexey Smirnov said:
We want to use allready written C sharp programs for our asp.net
applications. The idea is that we write a program ONCE and use this same
EXACT logic for our internet apps. Everything will run on the same server but
we will have two types of clients 1. web based, 2. intranet based. Is this
possible? If so, what is it called in Microsoft speak? How to links would be
appreciated.

You can identify the type of user by IP address, for example, if an
address starting with 10.*, it's an internal network IP.

if (Request.ServerVariables ["REMOTE_ADDR"].indexOf("10.") == 0) {
.....
 
G

Guest

We have heard of these two things but they are not exactly what we want. We
understand remoting to be a sort of physical shoving back and forth of data
between two apps. And Web services do not also fit our scenario. We have
existing allready written C# logic. We want asp.net (OR our internet
programs) to simply be able to use this C# logic. We are simply trying to
avoid the work of building two apps, one for web and one for intranet.
--
cheers,
nuutuudnet


Aidy said:
Look into "remoting" or "web services" as two possible solutions. Maybe web
services would be the better solution. You expose your code via web methods
and both the website and applications use the web service.
 
A

Aidy

Then just reference the dlls from your web project and you should be able to
use them as normal.

nuutuudnet said:
We have heard of these two things but they are not exactly what we want.
We
understand remoting to be a sort of physical shoving back and forth of
data
between two apps. And Web services do not also fit our scenario. We have
existing allready written C# logic. We want asp.net (OR our internet
programs) to simply be able to use this C# logic. We are simply trying to
avoid the work of building two apps, one for web and one for intranet.
 
A

Alexey Smirnov

We have heard of these two things but they are not exactly what we want. We
understand remoting to be a sort of physical shoving back and forth of data
between two apps. And Web services do not also fit our scenario. We have
existing allready written C# logic. We want asp.net (OR our internet
programs) to simply be able to use this C# logic. We are simply trying to
avoid the work of building two apps, one for web and one for intranet.
Everything will run on the same server

Does it mean you will have the same application with two kind of
users, or you will have two applications: one for internet and one for
intranet? I don't see any point to build a web service here
 
G

Guest

Exactly, I have web users and in house intranet users. But we want both users
to make database changes in exactly and precisely the same way as far as
types, as far as date conversions, whatever. We hope with dotnet to be able
to write one program here in house, compile it, put one on the internet and
one local (both actually physically in the same machine) we'll write a GUI in
c# for in-house and an asp.net (??) GUI for the web but the kernal business
logic is exactly and precisely the same c#. I am hoping that someone could
tell me that it is indeed as simple as Aidy says just refrencing the methods,
classes and variables.
 
A

Alexey Smirnov

Exactly, I have web users and in house intranet users. But we want both users
to make database changes in exactly and precisely the same way as far as
types, as far as date conversions, whatever. We hope with dotnet to be able
to write one program here in house, compile it, put one on the internet and
one local (both actually physically in the same machine) we'll write a GUI in
c# for in-house and an asp.net (??) GUI for the web but the kernal business
logic is exactly and precisely the same c#. I am hoping that someone could
tell me that it is indeed as simple as Aidy says just refrencing the methods,
classes and variables.
--
cheers,
nuutuudnet







- Show quoted text -

What I ment, is that you can setup one application on one server for
all users. You didn't say that it has to be different (intranet/
internet), so why don't you make your existing intranet ASP.NET
application available in the internet?
 
G

Guest

Maybe it is better to describe what we have now. What we have is one Visual
Basic dll of which each user has his own copy on his own computer in house.
Then we have a PHP based web portal where this Visual Basic business logic is
imitated. I read through the VB and write the exact logic in PHP. All above
named entities write to our central MS database. We run the PHP in Apache now
but would like to switch to IIS. Our current problem is, everytime something
changes in the Visual Basic, we have to write new PHP programs. We would like
one program which we could distribute to all our inhouse users (which we
allready do) --as well as-- internet portal. We allready have IIS an would
just need to switch over. The thing is, we will not want to switch over, when
we are forced to do with asp.net, what we allready have to do with PHP, that
is write a different program which trys to imitate the inhouse desktop
programs. Right now we have a windows programmer and a web programmer. We
hope to just have one windows programmer, and one program to maintain.
 
A

Alexey Smirnov

Maybe it is better to describe what we have now. What we have is one Visual
Basic dll of which each user has his own copy on his own computer in house.
Then we have a PHP based web portal where this Visual Basic business logic is
imitated. I read through the VB and write the exact logic in PHP. All above
named entities write to our central MS database. We run the PHP in Apache now
but would like to switch to IIS. Our current problem is, everytime something
changes in the Visual Basic, we have to write new PHP programs. We would like
one program which we could distribute to all our inhouse users (which we
allready do) --as well as-- internet portal. We allready have IIS an would
just need to switch over. The thing is, we will not want to switch over, when
we are forced to do with asp.net, what we allready have to do with PHP, that
is write a different program which trys to imitate the inhouse desktop
programs. Right now we have a windows programmer and a web programmer. We
hope to just have one windows programmer, and one program to maintain.
--

Thanks for the explanation. What is still not clear is why do you need
two kind of applications (VB and PHP site) to update the same
database. If there is no difference in terms of access and permissions
between intranet and internet users then why not just provide the
system over the web? (in your case, via a PHP-based portal).
 
G

Guest

That is a very deep philosophical question :) One reason amoung many is that
the system started out with the office app and then they added an internet
portal later. They expanded little by little. They want to stay with the same
model. Do you agree Smirnov with Aidy that the programs can simply be
referenced from asp.net? I am about to go out and buy a book but the choices
are overwelming and I just do not know which would fit my situation. One
thing is clear we will not be doing Web Services. We will only resort to
remoting if we cannot use/reuse ( or in this case reference) the c# in our
asp.net programs.
 
A

Alexey Smirnov

That is a very deep philosophical question :) One reason amoung many is that
the system started out with the office app and then they added an internet
portal later. They expanded little by little. They want to stay with the same
model. Do you agree Smirnov with Aidy that the programs can simply be
referenced from asp.net? I am about to go out and buy a book but the choices
are overwelming and I just do not know which would fit my situation. One
thing is clear we will not be doing Web Services. We will only resort to
remoting if we cannot use/reuse ( or in this case reference) the c# in our
asp.net programs.

Well, the point is that in any case you will have two applications.
And if idea was to reduce the cost of development then it doesn't
really help, I think. If I were you, I would either go for one web
client for everyone, or for a Smart Client (for Windows users,
deployed over the web).

http://en.wikipedia.org/wiki/ClickOnce
http://msdn.microsoft.com/msdnmag/issues/04/05/ClickOnce/
 
G

Guest

Thanks for the links but this will not fit our needs because we do a lot of
document opening, editing saving operations. This sounds like it has too
limited power. Just try to imagine everything that can be done on the desktop
in that program must also be done online (after going through a sign in
process). And yes we will have two applications, but they will both be
identical copies of the original the way we imagine it, or at least the way
we think it can be done with .net
 
A

Alexey Smirnov

Thanks for the links but this will not fit our needs because we do a lot of
document opening, editing saving operations. This sounds like it has too
limited power. Just try to imagine everything that can be done on the desktop
in that program must also be done online (after going through a sign in
process). And yes we will have two applications, but they will both be
identical copies of the original the way we imagine it, or at least the way
we think it can be done with .net
--
cheers,
nuutuudnet







- Show quoted text -

In this case you will need to create a library encapsulating your data
and business logic and use it both in WinForms and in ASP.NET.
Presentation layer will be different.

I found couple of articles that might be interesting for you

Create a Trickle-Feed Application
http://www.ftponline.com/vsm/2002_07/magazine/features/thomas/

Deploy WinForms on the Web
http://www.ftponline.com/vsm/2002_09/magazine/columns/desktopdeveloper/default_pf.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top