Using a data access DLL with HTML forms
I've agreed to help out a friend with getting their website off the ground. Previously, someone else helped out by writing a data access layer dll in C#, which I luckily have access to the code. Not any means to change and recompile though, as C# has never been one of my primary languages.
开发者_Python百科Problem is, I have no idea how I'm supposed to call it. In HTML, I tried out
<form action='dll/MyLib.dll' method='GET'>'
But I've no understanding how to call a specific function out of the DLL nor how to pass parameters. I'm not even sure if I managed to load it. For example, if I have an HTML form to add a new user to a MySQL database, I want to call the DLL's connection and addUser functions.
I found a 2005 article on DLLs and HTML, but trying out their code doesn't seem to work in actual practice: http://msdn.microsoft.com/en-us/library/3s0d4hwc%28v=vs.80%29.aspx
Anyone with any experience in this? I'm tempted to rewrite the DLL in a PHP script...
I think you're doing it wrong. While there "may" be a way to do what you're saying, there are much MUCH better/easier ways to go about this, one of which is using an IDE that understands .NET and can work with your C# code. I would recommend getting Visual Studio 2010 or WebMatrix if you can't afford VS2010 and learning how ASP.NET works.
It may take longer in the short run than whatever hacks people may or may not suggest here, but it will be a huge payoff in the long run, and who knows, maybe you'll really like programming in it :)
Do not call dll from html, please.
If you already have C#-related project, try ASP .NET.
精彩评论