If any of the steps mentioned in this page is not clear enough, please post your comments using the feedback form in the bottom of this page. We will add more explanation here so that it will be helpfull for everybody.
Introduction
SpiderAlerts tool is used by hundreds of our members to receive instant alerts from dotnetspider about Articles, Jobs, News, Questions and Answers when posted in the site.
The source code version of SpiderAlerts, which you an download from the link in the top of this page communicates with a sample web service that you can setup in your own computer. If you have internet connection, you can change the SpiderAlerts source code to communicate with the real dotnetspider web services. This is explained later in this page.
About SpiderAlerts
SpiderAlerts is a windows application that communicates with the web services hosted by dotnetspider.com. When you minimize, this tool disappears from the screen and you can see a small icon in the system tray which can be used to re activate the tool.
Even when the tool is hidden, it works silently in the background. At some regular intervals of time, it communicates with dotnetspider web services to find if there is any new alerts created. If it finds a new alert, the tool downloads the alerts and pops up a message displaying the alert. This message will include a short description and a URL to click. By clicking the URL, you can directly reach the dotnetspider page represented by the alert.
For example, when a new article is submitted in dotnetspider or when an answer is posted for your question, your SpiderAlerts tool will immediately popup alerting you to visit the page.

Web Services
A new alert is generated in dotnetspider.com when one of the following happens: A new article is submitted A new question is posted An answer is posted for a question A new job is posted A news is posted A new project is posted (there are few more...)
Technically, each alert is a record in an 'Alert' database table. One of the fields in the table represents the time the alert is generated. We expose one method through web services to retrieve these alerts to the SpiderAlerts application.
<WebMethod()> _ Public Function
GetAlerts(ByVal clientVersion As String, ByVal clientId As String, ByVal lastCheckTime As DateTime) As DataSet
This method takes few parameters :
clientVersion - the version number of the client application. We use this parameter to ensure that the correct version of the client application is used. If an older, incompatible version of cliet is connected, we will throw an exception. clientId - A Guid that uniquely identifies each client. This is just for statistical purposes to track how many clients are conncting. lastCheckTime - This parameter indicates the last time when the client downloaded the laerts. Only the alerts generated after the last check time is retunred by this method call.
When a client (SpiderAlerts tool) calls this web service method, it returns all new alerts as a DataSet.
Sample web services
If you do not have internet connection in your development computer, you can setup your own web services so that you can test the SpiderAlerts application.
To setup the sample webservices in your development machine, download the web service source code from the link in the top of this page. Extract the zip file to a folder in your machine. Right click on the folder 'AlertWebServices' and select the 'Properties'. Choose the 'Web Sharing' tab. Select the option 'Share this folder' and Save. (This step changes this folder as a virtual folder so that you can open it as a web application.)
Double click on the solution name 'AlertWebServices.sln' to open the sample webservices solution. Open the web.config file and edit the key 'AlertsDsn' to make sure the database connection string points to the correct location of database in your machine. The database file is located in thesame folder where you have the solution.
Now build the solution. Once you compile it, you can open the URL http://localhost/AlertWebServices/default.aspx in your browser. Create couple of new sample alerts by following the link 'Create New Alert' in the above web page.
Create an application to test the web services
Instead of 'SpiderAlerts' tool, you can write your own .NET application to retrieve the alerts. To do this, follow the easy steps below:
Create a new Windows application (C# or VB.NET) Drag and Drop a DataGrid control to the default Form (The default name for the datagrid will be DataGrid1) Drag and drop a button control to the form. Add a web reference to the dotnetspider web services. (Go to the solution explorer, right click on the 'References' section under your project name and select 'Add Web Reference'

In the dialog box to add web reference, specify the URL as http://localhost/AlertWebServices//spideralerts.asmx and press 'Go'
If it does not give any errors, press 'Add Reference' to add a web reference to the web services.
Once you have added a web reference to the web services, you can instantiate an object of the web service class and call the methods.
Double click on the button control in your sample application to add an event handler for the Button click event Add the following code : Dim service As New localhost.SpiderAlerts Dim ds As DataSet = service.GetAlerts("", "", DateTime.Now.AddDays(-30))
DataGrid1.DataSource = ds
The above code will retrieve the alerts from the webservices and bind the results to the data grid. If you run the application, you can see the data grid displaying the results from the web services, everytime you click the button. The result data set from the webservies contains additional information like Server time etc. The data grid will display this information also. If you want to see only the Alerts in the grid, bind the grid to the first table in the dataset as shown below:
Dim service As New localhost.SpiderAlerts Dim ds As DataSet = service.GetAlerts("", "", DateTime.Now.AddDays(-30))
DataGrid1.DataSource = ds.Tables(0)
Download real alerts from dotnetspider web services
If you are connected to internet, you can change the web reference in your test application to point to the dotnetspider web services and download the real alerts.
Go back to the sample windows application you created. Remove the web reference to your local webservices and add a new web reference to the URL http://www.dotnetspider.com/services/SpiderAlerts.asmx. Now run your application and you can see your data grid is displaying the real alerts from dotnetspider.
SpiderAlerts Tool
SpiderAlerts tool works the same way the sample windows application you have created. Some of the additional features of the SpiderAlerts tools is below:
SpiderAlerts tool has a timer control, which automatically call the web services to retrieve the latest alerts. You do not need to press any button to retrieve the alerts. This tool saves the 'Last Retrieve Time' in Isolated Storage. The web method is called with this value as a parameter so that it need to download only the new alerts each time. All downloaded alerts are stored in Isolated Storage so that it can still show you the already downloaded alerts even if you restart the computer. The actual SpiderAlerts tool supports posting answers to the alerts of type 'Question'. When a user posts a question in dotnetspider.com, you will get an alert and you can post an answer directly from the SpiderAlerts tool. But this feature is disabled in source code version for security reasons. This tool allows you to view one alert at a time and you can press Next/Previous buttons to navigate between alerts. You can delete all downloaded alerts from Isolate Storage by clicking the menu item 'Delete All Alerts'. When you minimize the application, the application disappears from screen and a small icon appears in the system tray. You can double click the icon in system tray to reactivate the tool. To close the tool, you must right click on the icon in system tray and select 'Close'. You can select one or more alert types and 'block' it. If an alert type is blocked, all alerts of that type will be hidden from the user. (All alerts are still in the isolated storage. When displayed to the user, it is just filtered out.)
NOTE: SpiderAlerts tool uses Isolated Storage which is a new feature in .NET. If you have version 1.0 of .NET, this tool will not work.
You can extend your sample application to have all features of SpiderAlerts tool. Refer to the source of SpiderAlerts tool and try to add all those features to your own test application. If you have any questions, please use the feedback link below to post questions.
Attachments8--121618--SpiderAlertSetup.msi (8--121618--SpiderAlertSetup.msi)8--121619--SpiderAlerts.zip (8--121619--SpiderAlerts.zip)8--121619--AlertsWebServices.zip (8--121619--AlertsWebServices.zip)
 8--121620--alert.gif
 8--121620--reference.jpg
|
| Author: Vasu Reddy | Member Level: Silver | Revenue Score:  |
Hi Tony nice code na thanq for posting this code.
Regards srinivas.d
|
| Author: jignesh | Member Level: Bronze | Revenue Score:  |
its improve knolange of web application.
|
| Author: Nushrat ali | Member Level: Bronze | Revenue Score:   |
Hi Tony Its really wonderfull keep posting this kind of a work. really helpful code assignment
Thank you very much for posting
Nushrat Tyagi
|
| Author: ketan Italiya | Member Level: Gold | Revenue Score:  |
hie, nice code....thanks
Regards ketan
|
| Author: Bunty | Member Level: Gold | Revenue Score:   |
Hi,
Really ausum piece of code.
Very good to start on .Net.
Keep posting such valuable code.
Thanks for sharing your knowledge.
Thanks and Regards S.S.Bajoria
|
| Author: siva | Member Level: Gold | Revenue Score:   |
Hi, Its really nice. I would like learn such type of things.
It will be greatful for me to send the files.
Thanks Rakesh, Siva Sreenath
|
| Author: Sonia sardana | Member Level: Gold | Revenue Score:     |
hello sir , As i m fresher in C#,many of mine concepts got clear thru ur project...Sir can u plz give me ASP.net project along with specifications,Cz i m very keen to developed it..Just give me the project...Cz i m working as vb.net developer, I do not have the idea if ASP.Net project..can u plz help me on this matter!!!..If you can,plz reply me on mine id sonia.sardana@yahoo.co.in
|