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.

41 lines
1.1 KiB

2 years ago
  1. using EasyBL.WebApi.Message;
  2. using System;
  3. using System.Windows.Forms;
  4. namespace EasyBL
  5. {
  6. public class WebBrowserService : ServiceBase
  7. {
  8. /// <summary>
  9. /// 錯誤信息派送
  10. /// </summary>
  11. /// <param name="i_crm">todo: describe i_crm parameter on ErrorMessage</param>
  12. /// <returns></returns>
  13. public ResponseMessage ErrorMessage(RequestMessage i_crm)
  14. {
  15. ResponseMessage rm = null;
  16. string sMsg = null;
  17. try
  18. {
  19. var sUrl = _fetchString(i_crm, "Url ");
  20. using (var webbrowser = new WebBrowser())
  21. {
  22. webbrowser.Navigate(sUrl);//浏览urlString表示的网址
  23. rm = new SuccessResponseMessage(null, i_crm);
  24. }
  25. }
  26. catch (Exception ex)
  27. {
  28. sMsg = Util.GetLastExceptionMsg(ex);
  29. }
  30. finally
  31. {
  32. if (null != sMsg)
  33. {
  34. rm = new ErrorResponseMessage(sMsg, i_crm);
  35. }
  36. }
  37. return rm;
  38. }
  39. }
  40. }