示例#1
0
 private static void Test_Adduser()
 {
     PSUser u = new PSUser() { RUser = "******", RPwd = "pwd", PSUserIds = new List<string> { "22", "3333" } };
     UserList ul = new UserList(@"C:\Docs\Pers\PSInterface\PSITest\bin\Debug\");
     ul.Load();
     ul.AddUser(u);
     ul.Save();
 }
示例#2
0
 private static void TestSave()
 {
     UserList ul = new UserList(@"C:\Docs\Pers\PSInterface\PSITest\bin\Debug\");
     if (ul.Load() < 0)
         Console.WriteLine("error");
     else
         Console.WriteLine("ok");
 }
示例#3
0
 private static void Test_GetUserForPSId()
 {
     UserList ul = new UserList(@"C:\Docs\Pers\PSInterface\PSITest\bin\Debug\");
     if (ul.Load() < 0)
         Console.WriteLine("error");
     else
         Console.WriteLine("ok");
     if (ul.GetUserIxForPSId("3333") >= 0)
         Console.WriteLine("Found 3333 ");
     if (ul.GetUserIxForPSId("99") < 0)
         Console.WriteLine("Not Found 99");
 }
示例#4
0
 private static void Test_UpdateUser()
 {
     UserList ul = new UserList(@"C:\Docs\Pers\PSInterface\PSITest\bin\Debug\");
     ul.Load();
     int ix = ul.GetUserIndex("111");
     if (ix >= 0)
     {
         ul.USrs[ix].PSUserIds.Add("44556");
         ul.USrs[ix].RPwd = "newpwd";
         ul.Save();
     }
 }
示例#5
0
 private static void Test_Init()
 {
     UserList ul = new UserList(@"C:\Docs\Pers\PSInterface\PSITest\bin\Debug\");
     ul.Load();
 }