Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I have a project , when mail drop to my gmail it is showing on the notification , it is working on my local system but when i host it on server it is not working.


My code is :-

System.Windows.Forms.NotifyIcon notification = new System.Windows.Forms.NotifyIcon();
C#
notification.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Server.MapPath("~/e_mail.ico"));
notification.Visible = true;
notification.ShowBalloonTip(30, "New Mail", dt.Rows[i]["Subject"].ToString(), System.Windows.Forms.ToolTipIcon.Info);



any solution....
Posted
Comments
Dave Kreskowiak 22-Nov-13 8:31am    
Why are you using Server.MapPath which only makes sense in an ASP.NET app and a NotifyIcon, which cannot be used in an ASP.NET app? Which type of application did you make??

And are you logged in on the Server console or over a Remote Desktop session??
Jimut123456789 22-Nov-13 23:53pm    
Except Server.MapPath if i am using any folder and put the image inside , then also it is not working, i have just use one page where i was testing notification and it is nicely working in my local system but when i put it in IIS then it is not working, i think the image path is not finding , becoz i have tested in my local system by hide the image , notification is not showing. How to slove the image path problem.
Dave Kreskowiak 23-Nov-13 0:17am    
You can NOT use NotifyIcon in a web app!! It's is a Windows Forms control ONLY!! Look at the namespace where it came from: System.Windows.Forms. Not from System.Web...

Learn how web apps work first. I highly suggest picking up a book on ASP.NET and working through it.

1 solution

Oh, of course it is working. Just turn on the monitor which is connected to the server, login with the IIS account and watch...
No, never can that work! And the reason can be found in the little rant above. Such questions are asked here so many times, I wonder: will students never understand the differences between an application running locally and a web page served from a distant computer?
 
Share this answer
 
Comments
Dave Kreskowiak 23-Nov-13 0:17am    
Even then, it wouldn't be seen. Services run on an entirely separate desktop from the one the user sees at the console.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900