Ejemplo n.º 1
0
 private void loadKB()
 {
     List<String> files = new List<string>();;
     //first we list the files available in the dir KB inside the database folder ("DB")
     //each file represents an update with some info inside it
     try
     {
         files = new List<String>(Directory.EnumerateFiles(Directory.GetCurrentDirectory() + @"\DB\KB", "*.inf"));
     }
     catch (UnauthorizedAccessException UAE)
     {
         MessageBox.Show("This software don't have the right to acess his own database :" + UAE.Message);
     }
     catch (PathTooLongException PathEx)
     {
         MessageBox.Show("The path to the database seems to long  :" + PathEx.Message);
     }
     finally
     {
         foreach (String file in files)
         {
             KBInfo tempKB;
             tempKB = new KBInfo(file); //third param : return the substring minus the last 4 char (ie .inf) //,"",file.Substring(0,file.Length-4)
             L_kbList.Add(tempKB);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Well you guess it it's an equals methode to test equality
 /// kinda useless in this software
 /// </summary>
 /// <param name="other">the parameter that will be tested against</param>
 /// <returns>true if equals</returns>
 public bool Equals(KBInfo other)
 {
     // Return true if the fields match:
     return this.number == other.number;
 }