在做一个华为的企业信息机,短信服务商提供了个 接口 SMEntry.dll,已将它放至bin文件夹下
以下为代码,运行到int count = SP_Startup("10.10.117.6,1393", "test", "test");
报错 “无法加载 DLL“SMEntry.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。”根据网上搜索的说把SMEntry.dll也都拷入C:\WINDOWS\system32\inetsrv和C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\,还是报无法加载 DLL
请各位高手指点迷津
以下为代码,运行到int count = SP_Startup("10.10.117.6,1393", "test", "test");
报错 “无法加载 DLL“SMEntry.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。”根据网上搜索的说把SMEntry.dll也都拷入C:\WINDOWS\system32\inetsrv和C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\,还是报无法加载 DLL
请各位高手指点迷津
{
public partial class Question : System.Web.UI.Page
{
[DllImport("SMEntry.dll")]
public static extern int SubmitShortMessage(string AtTime, string SourceAddr, string DestAddr, string Content, int ContentLen, int NeedStateReport, string ServiceID, string FeeType, string FeeCode);
[DllImport("SMEntry.dll")]
public static extern int SP_Startup(string DBName, string Account, string Password);
[DllImport("SMEntry.dll")]
public static extern void SP_Cleanup();
到int count = SP_Startup("10.10.117.6,1393", "test", "test"); 就报无法加载 DLL“SMEntry.dll
你在那台机器上用 就到那台机器上注册下那个DLL就可以了。
//如果是asp.net程序,必须是全路径,即便在bin下也必须写全路径,例如:
[DllImport(@"c:\xxxx\bin\SMEntry.dll")]
[DllImport("SMEntry.dll")]文档里面有对方提供的函数!
public static extern ...xi这样写一次!
然后调用即可!