![]() |
|
#1
|
||||
|
||||
![]() дали код на C#...
Код:
try { for (int i = 0; i < skype.HardwiredGroups.Count; i++) { if (skype.HardwiredGroups[i + 1].Type == TGroupType.grpUsersWaitingMyAuthorization) { if (skype.HardwiredGroups[i + 1].Users.Count > 0) { Command newcommand1 = new Command(); newcommand1.Command = "GET GROUP " + skype.HardwiredGroups[i + 1].Id + " USERS"; newcommand1.Blocking = true; newcommand1.Expected = "GROUP " + skype.HardwiredGroups[i + 1].Id + " USERS"; newcommand1.Timeout = 30000; skype.SendCommand(newcommand1); if (newcommand1.Reply.StartsWith(newcommand1.Expected)) { string[] Allresults = newcommand1.Reply.ToString().Replace("GROUP " + skype.HardwiredGroups[i + 1].Id + " USERS", "").Replace(" ", "").Split(new Char[] { ',' }); if (Allresults[0].Length > 0) { for (int j = Allresults.Length; j > 0; j--) { Command newcommand2 = new Command(); newcommand2.Command = "SET USER " + Allresults[j - 1].ToString() + " BUDDYSTATUS 2"; newcommand2.Blocking = true; newcommand2.Expected = "USER " + Allresults[j - 1].ToString() + " BUDDYSTATUS 3"; newcommand2.Timeout = 30000; skype.SendCommand(newcommand2); if (!newcommand2.Reply.StartsWith(newcommand2.Expected)) MessageBox.Show("Bad Reply for: " + newcommand2.Command.ToString() + " Reply: " + newcommand2.Reply.ToString()); } } } else MessageBox.Show("Hardwired Group Reply Error: " + newcommand1.Reply.ToString()); } break; } } } catch (Exception e) { // All Skype Logic uses TRY for safety MessageBox.Show("Pending Authorization Group Error- Exception Source: " + e.Source + " - Exception Message: " + e.Message); } ![]() Код:
try begin for (int i = 0; i < skype.HardwiredGroups.Count; i++) begin if (skype.HardwiredGroups[i + 1].Type == TGroupType.grpUsersWaitingMyAuthorization) begin if (skype.HardwiredGroups[i + 1].Users.Count > 0) begin Command newcommand1 = new Command(); newcommand1.Command = 'GET GROUP ' + skype.HardwiredGroups[i + 1].Id + ' USERS'; newcommand1.Blocking = true; newcommand1.Expected = 'GROUP ' + skype.HardwiredGroups[i + 1].Id + ' USERS'; newcommand1.Timeout = 30000; skype.SendCommand(newcommand1); if (newcommand1.Reply.StartsWith(newcommand1.Expected)) begin string[] Allresults = newcommand1.Reply.ToString().Replace('GROUP ' + skype.HardwiredGroups[i + 1].Id + ' USERS', '').Replace(' ', '').Split(new Char[] begin ',' end); if (Allresults[0].Length > 0) begin for (int j = Allresults.Length; j > 0; j--) begin Command newcommand2 = new Command(); newcommand2.Command = 'SET USER ' + Allresults[j - 1].ToString() + ' BUDDYSTATUS 2'; newcommand2.Blocking = true; newcommand2.Expected = 'USER ' + Allresults[j - 1].ToString() + ' BUDDYSTATUS 3'; newcommand2.Timeout = 30000; skype.SendCommand(newcommand2); if (!newcommand2.Reply.StartsWith(newcommand2.Expected)) MessageBox.Show('Bad Reply for: ' + newcommand2.Command.ToString() + ' Reply: ' + newcommand2.Reply.ToString()); end end end else MessageBox.Show('Hardwired Group Reply Error: ' + newcommand1.Reply.ToString()); end break; end end end catch (Exception e) begin // All Skype Logic uses TRY for safety MessageBox.Show('Pending Authorization Group Error- Exception Source: ' + e.Source + ' - Exception Message: ' + e.Message); end |