从ASP.NET Web服务调用C DLL [英] Calling C DLL From ASP.NET Web Service

查看:176
本文介绍了从ASP.NET Web服务调用C DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,这是这个项目的总工作流程

Hi this is the total workflow of this project

我们有一个应用程序用cobol编写,可以只使用一个 C DLL 与该应用程序进行通信,我们必须在 dll 在下方给出

we have a application which is written in cobol, wee can communicate to that application using only a C DLL, the method which we have to call in the dll is given below

[DllImport(@"C:\CCExpert\haz450cp.dll", EntryPoint = "HAZ450CP", CallingConvention = CallingConvention.Cdecl)]
    unsafe public static extern void HAZ450CP(ref p45_control p45_controlx, out p45_clreturn p45_clreturnx, ref p45_clclaim p45_clclaimx);

我们所做的是我们调用 C dll C#DLL ,这个 C#dll 在控制台应用程序中工作正常,这意味着我们可以输入它和我们正在从控制台应用程序获得正确的输出。

what we did is we are invoking that C dll from a C# DLL, this C# dll working fine with console application, it means we can give the input to it and we are getting proper output also from console application.

但是当我尝试调用相同的 C#DLL ASP.NET WebService 其给出错误

But when i try to call the same C#DLL from the ASP.NET WebService its giving error

谢谢

推荐答案

我知道这可能听起来有点愚蠢,但是你的asp.net用户可以从DLL的目录中读取内容?

I know this might sound a little stupid, but can your asp.net user read contents from the directory where the DLL is located?

您可以通过将DLL复制到Web应用程序文件夹的bin目录并更改DLL p来执行此测试ath从C:\CCExpert\haz450cp.DLL到just440cp.DLL

You can do this test by copying you DLL to the bin directory of your web application folder and changing the DLL path from C:\CCExpert\haz450cp.DLL to just haz450cp.DLL

这篇关于从ASP.NET Web服务调用C DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆