C
CSLCO
Hello,
I'm beginner in C#, and I want to make several function in a C# DLL,
whiches I can call from FoxPro 9.0.
I try something like that :
FOR the DLL in C# :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
namespace CmFox
{
public class CarteReseau
{
//using System.Net.NetworkInformation;
public CarteReseau()
{
}
public static string MacAdresse()
{
string resultat = "";
IPGlobalProperties computerProperties =
IPGlobalProperties.GetIPGlobalProperties();
NetworkInterface[] nics =
NetworkInterface.GetAllNetworkInterfaces();
if (nics == null || nics.Length < 1)
{
resultat += String.Format(" No network interfaces
found.");
return (resultat);
}
foreach (NetworkInterface adapter in nics)
{
IPInterfaceProperties properties =
adapter.GetIPProperties();
resultat +=
String.Format("{0}",adapter.GetPhysicalAddress().ToString());
}
return (resultat);
}
}
}
-------------------------------------------------------------------------
-------------------------------------------------------------------------
And this code in FoxPro :
declare string CarteReseau.MacAdresse in cmfox.dll as ReadMac ;
Activate Screen
? ReadMac()
-------------------------------------------------------------------------
And Fox Pro returns me a "No entry point for CarteReseau.MacAdresse in
CmFox.dll"
Could you help me
Thanks fo that
I'm beginner in C#, and I want to make several function in a C# DLL,
whiches I can call from FoxPro 9.0.
I try something like that :
FOR the DLL in C# :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
namespace CmFox
{
public class CarteReseau
{
//using System.Net.NetworkInformation;
public CarteReseau()
{
}
public static string MacAdresse()
{
string resultat = "";
IPGlobalProperties computerProperties =
IPGlobalProperties.GetIPGlobalProperties();
NetworkInterface[] nics =
NetworkInterface.GetAllNetworkInterfaces();
if (nics == null || nics.Length < 1)
{
resultat += String.Format(" No network interfaces
found.");
return (resultat);
}
foreach (NetworkInterface adapter in nics)
{
IPInterfaceProperties properties =
adapter.GetIPProperties();
resultat +=
String.Format("{0}",adapter.GetPhysicalAddress().ToString());
}
return (resultat);
}
}
}
-------------------------------------------------------------------------
-------------------------------------------------------------------------
And this code in FoxPro :
declare string CarteReseau.MacAdresse in cmfox.dll as ReadMac ;
Activate Screen
? ReadMac()
-------------------------------------------------------------------------
And Fox Pro returns me a "No entry point for CarteReseau.MacAdresse in
CmFox.dll"
Could you help me
Thanks fo that