当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: dataset 中有 a,b 两表, a 例 字段1 字段2 字段3 0001 库存1 盘点人1 0002 库存2 盘点人2 b 例 字段1 字段2 字段3 0001 上月数 安全库存数 0001 上月数 安全库存数 如何变成 表3 字段1 字段2 字段3 字段4 字段5 0001 库存1 盘点人1 上月数 安全库存数 0001 库存2 盘点人2 上月数 安全库存数 字段1 字段2 字段3......
    摘要: 我需要计算一个字符串表达式,如expression="3+4*5"。假如是expression=3+4*5则可以顺利进行四则运算,不知道用字符串得到的表达式怎么进行计算呢?有没有简单的办法? ......


关于PDA序列号

用C#开发PDA程序,PDA操作系统是PPC2003,请问在程序获取序列号?谢谢

NO.1   作者: covis

using   System.Runtime.InteropServices;  
  using   System.Text;  
  ///   <summary>  
  ///   的PPC序列号  
  ///   </summary>  
   
  private   static   Int32   _0x1F8CA   =   0;  
  private   static   Int32   _0x1F81D   =   0;  
  private   static   Int32   _0x39CF8   =   0x00000101;  
   
  private   const   Int32   _0xC0000000   =   0x32;  
  private   const   Int32   _0x00000231   =   0x7A;  
   
  private   static   Int32   _0x9C8F71F3   =   ((_0x39CF8)   <<   16)   |   ((_0x1F81D)   <<   14)   |   ((21)   <<   2)   |   (_0x1F8CA);  
   
  [DllImport("CoreDll.dll",   SetLastError=true)]  
  private   static   extern   bool   KernelIoControl(Int32   dwIoControlCode,   IntPtr   lpInBuf,   Int32   nInBufSize,   byte[]   lpOutBuf,   Int32   nOutBufSize,   ref   Int32   lpBytesReturned);  
   
  [DllImport("CoreDll.dll",   SetLastError=true,   CharSet=CharSet.Auto)]  
  private   static   extern   bool   KernelIoControl(int   dwIoControlCode,  
  IntPtr   lpInBuf,   int   nInBufSize,   IntPtr   lpOutBuf,   int   nOutBufSize,   IntPtr  
  lpBytesReturned);  
   
  public   static   string   ReturnPPCSerial()  
  {  
  byte[]   outbuff =   new   byte[20];  
  Int32     dwOutBytes;  
  bool   done =   false;  
   
  Int32   nBuffSize =   outbuff.Length;  
   
  BitConverter.GetBytes(nBuffSize).CopyTo(outbuff,   0);      
  dwOutBytes =   0;  
  while   (!   done)  
  {  
  if   (KernelIoControl(_0x9C8F71F3,   IntPtr.Zero,   0,   outbuff,   nBuffSize,   ref   dwOutBytes))  
  {  
  done =   true;  
  }  
  else  
  {  
  int   error =   Marshal.GetLastWin32Error();  
  switch   (error)  
  {  
  case   _0xC0000000:  
  break;  
  case   _0x00000231:  
  nBuffSize =   BitConverter.ToInt32(outbuff,   0);  
  outbuff =   new   byte[nBuffSize];  
  BitConverter.GetBytes(nBuffSize).CopyTo(outbuff,   0);  
  break;  
  default:  
  break;  
  }  
  }  
  }  
   
  Int32   dwPresetIDOffset =   BitConverter.ToInt32(outbuff,   0x4);     //   DEVICE_ID.dwPresetIDOffset  
  Int32   dwPresetIDSize =   BitConverter.ToInt32(outbuff,   0x8);     //   DEVICE_ID.dwPresetSize  
  Int32   dwPlatformIDOffset =   BitConverter.ToInt32(outbuff,   0xc);     //   DEVICE_ID.dwPlatformIDOffset  
  Int32   dwPlatformIDSize =   BitConverter.ToInt32(outbuff,   0x10);   //   DEVICE_ID.dwPlatformIDBytes  
  StringBuilder   sb =   new   StringBuilder();  
   
  sb.Append("_");  
  for   (int   i   =   dwPresetIDOffset;   i   <   dwPresetIDOffset   +   dwPresetIDSize;   i++)  
  {  
  sb.Append(String.Format("{0:X2}",   outbuff[i]));  
  }  
   
  sb.Append("_");  
  for   (int   i   =   dwPlatformIDOffset;   i   <   dwPlatformIDOffset   +   dwPlatformIDSize;   i   ++   )      
  {  
  sb.Append(   String.Format("{0:X2}",   outbuff[i]));  
  }  
  return   sb.ToString();  
  }


    摘要: 邹建大侠:部门组织结构数据在一张表里,如何导出来xml. 输出结果: 公司总部 总经办 人力资源部 人事科 ........ 公司组织结构图的形式 ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE