Hi,
I need help please, the problem is that i have a user dll in a Pc desktop (user's pc) and i need to use that dll in a web page because dll expose functionality of the user's pc. How i can do it to call that dll from the website?.
In Spanish (Por favor, necesito ayuda, el problema es que tengo un archivo DLL de usuario en una PC de escritorio (usuario de PC) y necesito utilizar ese archivo DLL en una pagina web porque la dll expone funcionalidad de la PC del usuario. ¿Cómo puedo hacer para llamar esa DLL desde el sitio web?
Loading
Sam HobbsPosted Feb 27, 2010, 8:07 PM
Next, I think you are saying that this is an intranet; is that correct? If so, then instead of thinking in terms of internet and intranet, think in terms of a network. You need to execute a DLL over the network; does that sound correct? You don't need to do it in a "web site", correct? Looking at it that way, you get many options.
If it is a COM object DLL, then the solution might be very easy; COM objects can be used across systems using DCOM, and you probably don't need to do any programming for the system that the DLL is in. There is also something called COM+ that I don't know a lot about that might help.
.Net has various inter-system communication solutions. You could write a sockets server and client. You could use RPC, but note that DCOM uses RPC and DCOM would be more flexible. .Net has Remoting; see the articles in this web site for help with remoting. I don't know much about the Windows Communication Foundation (WCF) but it is my understanding that it is the latest technology for inter-system communication.
theLizardPosted Feb 27, 2010, 3:33 PM
You have x number of local machines with devices on com port is that correct?
These need to communicate what with the website?
What is the provider DLL and what is the language it is written in and what are the export functions.
It maybe possible to write a go between for the local machines to communicate with the DLL through it's export functions and stream the data via a web request but only if the provider dll does not need to be on the server end.
Just a thought that may help.
theLizardPosted Feb 27, 2010, 3:23 PM
If on the other hand it needs to be on an external website hosted somewhere else in the world, you also need to have permissions set of the folder to allow the dll to run and this is where the problem is.
If you have your own dedicated server with an ISP then you can do that without too much difficulty, the difficulty is getting the ISP to let you run the dll.
Even if you created a Windows Service, the problem is still the fact that the DLL must be given permission to run on the server, without that permission you will get execution exceptions.
To give an example, the issue I had was this,
I have a web site that required a higher level of security, C#, is an OK language to write in BUT it is not built to protect intellectual property too well, what I mean by this is that anyone with a reverse engineering tool like Reflector.exe can recreate the code from any C# EXE or DLL. To overcome this issue since I wanted to protect my intellectual property and to ensure that security could NEVER be breached I wrote oart of the webs code behind into a C# DLL which was obfuscated using my own obfuscation tool and a C++ DLL.
Users interact with the website using the standard web pages, on the server side calls are made by the pages code behind to the C# DLL, the C# DLL then calls functions in the C++ DLL (you could loosely call this side of things a web service of un managed code) then returns values back to the C# DLL, if all is ok then proceed.
So we have web page request --> c# dll --> c++ dll response c++ dll --> c# dll --> web page.
So the problem is if it is not part of the website assembly, it is a foreign executable (which is what a dll is) and this needs a higher level of permission to run on the server.
If it is on an intranet, you can give those permissions through IIS for your users, if it is on an external server where you do not have the control over IIS then you need to get those that do have the control to do that BUT no ISP will allow you to run executable like dlls on shared hosting servers.
I hope I have answered you question.
Ps I overcame my problem by getting a dedicated server it was the ONLY way I could do it.
Armando LazartePosted Feb 27, 2010, 11:58 AM
How you think that the problem can be solve.
Say "it's impossible" isn't an option.
Maybe a windows service listening/reading/writting a temp buffer to communicate with the website is an alternative.
Another idea or complete this one is welcome.
theLizardPosted Feb 26, 2010, 11:00 PM
You can however call your dll functions if the dll is on your website BUT and it is a BIG BUT, you need to have execute permission for un managed code on the folder where the dll is to be run from that is usually a bin folder and unless you run your own dedicated server your isp will NOT allow you to do that for very obvious reasons.