110,546
社区成员
发帖
与我相关
我的任务
分享
public partial class MainInterface : Window
{
public delegate string CallBack(int num);
[DllImport("Sandu.dll", EntryPoint = "Plugin_Tel", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern bool Plugin_Tel(int port);
[DllImport("Sandu.dll", EntryPoint = "Setup_Tel", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern void Setup_Tel(CallBack fPost2User, int getall);
[DllImport("Sandu.dll", EntryPoint = "GetNumber_Tel", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern string GetNumber_Tel(int port);
public static string GetNumber(int num)
{
string telAddress = GetNumber_Tel(1);
MessageBox.Show(telAddress);
return telAddress;
}
public MainInterface()
{
Setup_Tel(numberCallBack, 0);
}
bool plug = Plugin_Tel(1);
if (!plug)
{
MessageBox.Show("Please Plug the CallID Device Application is Closing Now!!!", title, MessageBoxButton.OK);
this.Close();
}
namespace namespace
public delegate string CallBack(int num);
public partial class MainInterface : Window
{
[DllImport("Sandu.dll", EntryPoint = "Plugin_Tel", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern bool Plugin_Tel(int port);
[DllImport("Sandu.dll", EntryPoint = "Setup_Tel", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern void Setup_Tel(CallBack fPost2User, int getall);
[DllImport("Sandu.dll", EntryPoint = "GetNumber_Tel", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)]
public static extern string GetNumber_Tel(int port);
public static string GetNumber(int num)
{
string telAddress = GetNumber_Tel(1);
MessageBox.Show(telAddress);
return telAddress;
}
public MainInterface()
{
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
Setup_Tel(numberCallBack, 0);
}
MessageBox.Show(telAddress);
我想把这个telAddress放在一个变量里面然后再存到数据库里面去的,可是现在怎么弄呢??那个全局变量弄不进去啊...拜托各位帮帮忙吧