日期:2014-05-17 浏览次数:21046 次
typedef struct ProClass
{
char* ProClassName;//产品类型
char* ProClassRegDate;//产品类型添加时间
ProClass* next;
}ProClass,*ProClassLink;
//添加产品类
void AddProClass(ProClass proclass)
{
FILE* fp;
fp=fopen("ProClass.txt","ab");
fprintf(fp,"%s %s",proclass.ProClassName,proclass.ProClassRegDate);
fclose(fp);
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct ProClass
{
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)]
public string ProClassName;
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)]
public string ProClassRegDate;
public System.IntPtr next;
}
[DllImport("linklist.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
private extern static void AddProduct(LinkList product);
public static void AddProClass(string ProClassName)
{
ProClass proclass = new ProClass();
proclass.ProClassName = ProClassName;
proclass.ProClassRegDate = GetTime();
proclass.next = IntPtr.Zero;
AddProClass(proclass);
}