谁会将dll文件中的这个函数:VARIANT_BOOL Connect_Net( [in] BSTR IPAdd,[in] long Portl)通过C#调用出来吗我在vs里面写了一段代码,结果不行:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace MyProject00
{
class Program
{
[DllImport(@"F:\project\zkemsdk.dll", CallingConvention = CallingConvention.StdCall)]
public static extern bool Connect_Net([MarshalAs(UnmanagedType.BStr)] String ipadd, long port);
[return: MarshalAs(UnmanagedType.VariantBool)]
static void Main(string[] args)
{
if (Connect_Net("192.168.1.200", 4370))
{
Console.WriteLine("Connect ok!!!");
Console.ReadKey();
}
else
{
Console.WriteLine("Connect fail!");
Console.ReadKey();
} }
}
}这个dll文件是某公司的门禁系统的动态链接库。可是我使用exeScope却没有看到相关的函数。
我不知道为什么,有牛人可以帮我解答一下吗?感激不尽。如果需要看一下相关手册,留下邮箱吧~我发给你。C#VARIANT_BOOL Connect_NetBSTR IPAdd
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace MyProject00
{
class Program
{
[DllImport(@"F:\project\zkemsdk.dll", CallingConvention = CallingConvention.StdCall)]
public static extern bool Connect_Net([MarshalAs(UnmanagedType.BStr)] String ipadd, long port);
[return: MarshalAs(UnmanagedType.VariantBool)]
static void Main(string[] args)
{
if (Connect_Net("192.168.1.200", 4370))
{
Console.WriteLine("Connect ok!!!");
Console.ReadKey();
}
else
{
Console.WriteLine("Connect fail!");
Console.ReadKey();
} }
}
}这个dll文件是某公司的门禁系统的动态链接库。可是我使用exeScope却没有看到相关的函数。
我不知道为什么,有牛人可以帮我解答一下吗?感激不尽。如果需要看一下相关手册,留下邮箱吧~我发给你。C#VARIANT_BOOL Connect_NetBSTR IPAdd
VARIANT_BOOL Connect_Net([in] BSTR IPAdd, [in] long Portl)
就是
bool Connect_Net(string IpAdd, long Port1)
大神你不要把每个人都想象成你那样,就几个字还不如不说,说了还容易误导别人