A skype history message viewer written in c#
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using SKYPE4COMLib;
  11. namespace Skype_History_Viewer
  12. {
  13. public partial class FrmMain : Form
  14. {
  15. private Boolean connected = false;
  16. private Skype skype = new Skype();
  17. public FrmMain()
  18. {
  19. InitializeComponent();
  20. connected = connectToSkype();
  21. }
  22. private void cmdAdd_Click(object sender, EventArgs e)
  23. {
  24. if(!connected)
  25. {
  26. errorMessage();
  27. }
  28. else
  29. {
  30. }
  31. }
  32. private void errorMessage()
  33. {
  34. connected = connectToSkype();
  35. if(!connected)
  36. {
  37. MessageBox.Show("Could not connect to skype, please make sure that skype is running and this plugin is allowed.");
  38. }
  39. }
  40. private Boolean connectToSkype()
  41. {
  42. try
  43. {
  44. //attaches the program to skype
  45. skype.Attach();
  46. //adds all users to lstUsers
  47. if(!connected)
  48. {
  49. foreach (User user in skype.Friends)
  50. {
  51. lstUsers.Items.Add(user.FullName);
  52. }
  53. }
  54. return true;
  55. }
  56. catch
  57. {
  58. return false;
  59. }
  60. }
  61. private void cmdExport_Click(object sender, EventArgs e)
  62. {
  63. if (!connected)
  64. {
  65. errorMessage();
  66. }
  67. else
  68. {
  69. }
  70. }
  71. private void cmdExportAll_Click(object sender, EventArgs e)
  72. {
  73. if (!connected)
  74. {
  75. errorMessage();
  76. }
  77. else
  78. {
  79. }
  80. }
  81. private void cmdClear_Click(object sender, EventArgs e)
  82. {
  83. lstChat.Items.Clear();
  84. }
  85. }
  86. }