Link to home
Start Free TrialLog in
Avatar of ashishnaik1
ashishnaik1

asked on

Generate Alert in ASP.NET

I want to generate alert using asp.net. Scenario is; In one stock website I found stock x is at $50. I want to get informed when the stock reaches $60.  System should send me an e-mail when it reaches to $60. I don't want a program running in a background (in schedular of windows) to do this task.
Thanks
-Ashish
Avatar of kblack15217
kblack15217

This can be acheived by taking advantage of the threading namespace available in .NEt.   Basically, the idea is that you spawn off a thread which has access to the parent object.   It keeps track of a property in the parent object, in this case, stock price.    In a loop, if the stock price is less than 60, it just sleeps and tries again.  But when it is above 60, you can use the parent object to invoke a callback method, which will handle your alert.

Threading is too detailed to get into on here, but here is a place to start reading.

http://www.devasp.net/net/search/default.asp?c_id=560
Ashish,

Your criteria about background/scheduling is not clear.  There are two ways your program could run:

1. An EXE that constantly monitors the stock and sends email when some condition is reached, or
2. An EXE that checks the stock once, and that EXE is scheduled to run on a regular interval.

I'm not sure which one you're asking about.  In either case, this sort of application is probably more at home in the C# category as it is not the sort of thing you would code as an ASP.NET page.  Well: you could code it as an ASP.NET page, and keep on hitting "Refresh."
Good point barry,
I kind of lost track of the ASP.Net part.  Threading is a solution that will work better with desktop appliations.   HOwever ASP.NET can be C#, or VB.NEt, or any other supported language.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    PAQ - no points refunded

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

vnvk
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial