如何在asp.net中显示Windows服务进程的通知图标? [英] How to show a notify icon for a windows service process in asp.net?

查看:77
本文介绍了如何在asp.net中显示Windows服务进程的通知图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net中显示Windows服务进程的通知图标?

我的代码如下:



< pre lang =cs> private void showBalloon( string 标题,字符串正文)
{
NotifyIcon notifyIcon = new NotifyIcon的();
notifyIcon.Visible = true ;

if (title!= null
{
notifyIcon.BalloonTipTitle = title;
}

如果(body!= null
{
notifyIcon.BalloonTipText = body;
}

notifyIcon.ShowBalloonTip( 30000 );
}



通知图标未见

解决方案

Windows服务没有桌面,所以你不能显示通知图标。



解决方法是创建一个单独的程序并使用ServiceController [ ^ ]与您的服务或其他进程间通信方法交互以交换数据。



与ASP.NET有什么关系我不确定,Windows服务不是ASP.NET,NotifyIcon不适用于Web项目..

How to show a notify icon for a windows service process in asp.net?
My code is as follows:

private void showBalloon(string title, string body)
  {
      NotifyIcon notifyIcon = new NotifyIcon();
      notifyIcon.Visible = true;

      if (title != null)
      {
          notifyIcon.BalloonTipTitle = title;
      }

      if (body != null)
      {
          notifyIcon.BalloonTipText = body;
      }

      notifyIcon.ShowBalloonTip(30000);
  }


Notify Icon not seen

解决方案

Windows Services do not have a desktop, so you can't show notify icons.

The solution to this is to create a separate program and use ServiceController[^] to interact with your service, or other interprocess communication methods to exchange data.

What this has to do with ASP.NET I'm not sure, Windows Services are not ASP.NET, and NotifyIcon isn't available for web projects...


这篇关于如何在asp.net中显示Windows服务进程的通知图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆