QQIsLine.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Net;
  6. using System.Drawing;
  7. namespace Ant.Service.Utilities
  8. {
  9. //public static class QQIsLine
  10. //{
  11. // /// <summary>
  12. // /// 判断QQ是否在线
  13. // /// </summary>
  14. // /// <param name="qq"></param>
  15. // /// <returns></returns>
  16. // public static bool CheckQQOnline(string qq)
  17. // {
  18. // WebRequest webRequest = WebRequest.Create("http://wpa.qq.com/pa?p=2:" + qq + ":4");
  19. // WebResponse webResponse = webRequest.GetResponse();
  20. // Bitmap myImage = new Bitmap(webResponse.GetResponseStream());
  21. // if (myImage.Width == 23)
  22. // {
  23. // return true;
  24. // }
  25. // string str = "";
  26. // switch (myImage.Width)
  27. // {
  28. // case 23:
  29. // str = "QQ在线"; break;
  30. // case 16:
  31. // str = "微信在线"; break;
  32. // case 77:
  33. // str = "苹果在线"; break;
  34. // }
  35. // return false;
  36. // }
  37. //}
  38. }