コード例 #1
0
 public bool GetDTUList(out Dictionary <uint, DTUInfoStruct> dtuList)
 {
     try
     {
         int cnt = DLLGetModemCount();
         //System.Diagnostics.Debug.WriteLine("Count="+cnt.ToString());
         dtuList = new Dictionary <uint, DTUInfoStruct>();
         for (uint ii = 0; ii < cnt; ii++)
         {
             DTUInfoStruct dtu  = new DTUInfoStruct();
             bool          flag = DLLGetModemByPosition(ii, ref dtu);
             if (!flag)
             {
                 this.GetLastError();
                 return(false);
             }
             else
             {
                 dtuList.Add(dtu.m_modemId, dtu);
             }
         }
         LastError = null;
         return(true);
     }
     catch (Exception ee)
     {
         LastError = ee.Message;
         dtuList   = new Dictionary <uint, DTUInfoStruct>();
         return(false);
     }
 }
コード例 #2
0
 // public static extern bool DLLGetModemByPosition(UInt32 pos, ref DTUInfoStruct pModemInfo);
 private static extern bool DLLGetModemByPosition(uint pos, ref DTUInfoStruct pModemInfo);