Click here to Skip to main content
13,052,342 members (56,460 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello, I have a job to do for a company that I have users and tickets management and stood in a part and can not progress, so I decided to come ask for your help. What I want is to log in and users of unregistered shares in C # and all the parts of administration and supervision in, the problem is that I do not know how can i make the connection between C # and, indeed I do not know if it is possible to do so. What I ask is that if you can tell me and teach me some clue how to get to that I want, I have no code about it, i tried but i didnt reach the goal, but the idea is explained above.
ty in advance
Posted 2-Jul-12 23:51pm
perilbrain 3-Jul-12 5:58am
wasn't this link a thing of your concern ???
Zoltán Zörgő 3-Jul-12 5:59am
As ASP.NET is a web framework + platform over .NET CLR, C# is a .NET language and you can do ASP.NET in C#.
What is the exact problem?
Zoltán Zörgő 3-Jul-12 6:08am
You want to interact with an web forms application from a windows forms application?
yes i want to interact 2 projects one in c# and another in
Makes no sense as formulated. Perhaps you should start from you ultimate goals, not focusing on your idea how to achieve it.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

What i understood from the question is that you want to know whether it is possible to use ASP.NET and some existing C# code in unison.

ASP.NET websites actually use C# as the programming language(VB is also a choice)

ASP.NET does the scripting part which will will be translated to the respective HTML by the framework. the actual business logic is mostly written in C#.

So you can wrap your existing C# code in some logical classes that makes sense as per the application domain and perhaps put it inside a class library. You can use this class library from a ASP.NET website just by adding reference to it.

I hope my understanding of the question is correct. If not please let me know and I will try to refine the answer.
i'll try to give more detailed information with an example:
i have a login (made in c#) and another form to change password when i get in the application for the first time (also in c#)
then if the user is correct, there is a profile validation, so if its a normal user (with basic functions) it appears another form (in c#) when is an administrator, it appears a page in so my doubt is how to connect c# to, do i have to put an hiperlink?
Rahul Rajat Singh 3-Jul-12 6:23am
the forms that you are talking about. are they WINFORMS. because it seems whenever you are using word made in C#, you are actually trying to say a winform page. Am I right?
the forms that im talking about are windows form, it can be done in wpf too but windows form are good for what is needed
and another thing i did the pages in another project, is it wrong? :/ if it was in the same project it wasnt difficult
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

As ASP.NET is a web framework and platform over .NET CLR, and C# is a .NET language and you can do ASP.NET in C#, you better say web application and windows application, because you might confuse one. According to your clarification, you want to control (kind of) a web application from a windows application.
A) The best way would be to publish web services or wcf services and consume them from the windows applications.
If you can't add this feature, you can exchange data between the two applications in following ways:
B1) Automate a browser (Internet Explorer) via COM - you will have to code interfaces
B2) Use WebBrowser control - but you have to code browser functions
C) Use HttpClient class - there is noting visible, you have to simulate the browser actions and the logic of the client side code
D) Some other IPC - even more to code
ty very much for your help, it helped me understand and im stating to search more about WCF
ty :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Separate answer to avoid clutter:

To open a ASP.NET website from a windows application:

1. If the website is already hosted on a public server

ProcessStartInfo sInfo = new ProcessStartInfo("");  

2. If it is on the same machine
----a. configure the site inside a vitual directory in IIS ( say mysite )
----b. do this
ProcessStartInfo sInfo = new ProcessStartInfo("http://localhost/mysite/default.aspx");  

I hope you will get things to work with this. if not do let me know and I will try to see what i can do.
ty very much i'll try this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 4 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100