![]() |
Web Development »
Ajax and Atlas »
Samples
Intermediate
License: The Code Project Open License (CPOL)
An ASP.NET/AJAX Interface for UtorrentBy mattsrebatespamAn ASP.NET/AJAX interface for the utorrent application. |
Javascript, CSS, HTML, Windows (Win2K, WinXP, Win2003, Vista), .NET 2.0, .NET 3.0, .NET 3.5, ASP, ASP.NET, Ajax, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
I recently discovered that the bittorrent application µtorrent contained a Web interface. I eventually got it up and running and thought it was pretty neat. I wanted to customize it and make it my own. So, I searched the Web and came across a set of C# classes that hooked into the official µtorrent Web UI. The original posting is located here. In that same posting, there was also a post about an ASP.NET interface using the C# classes. I tested it out, and thought I could build my own and overcome some of the quirks it had. I also thought it would be a test of what was possible with AJAX.
Getting it up and running should be fairly straightforward. What is needed is IIS, .NET 3.5, and a recent version of µtorrent with the Web UI enabled. If you have trouble running the site, you may also need the AJAX Control Toolkit. There is also a Windows service that gathers stats for each of the torrents.
To get started, copy the files to your server's directory. Make sure that the directory is configured as an application. Open your Web browser and point it towards the URL of the directory you created. The first time the application runs, it will detect that the settings are invalid and will prompt you to enter them. Once completed, click the Save button to commit the changes. If you wish to encrypt the information within the web.config, you can click the Link Button on the Settings page to do that. If you click it and go through the confirmation, the appSettings section of the web.config will be encrypted.
I decided to use the HTTP Compression features of this project in the hopes of speeding things up a bit.
I also added in an extremely simple HttpModule to handle the security since I did not want to mess with or rely on the IIS security. In a shared hosting environment, you also might not have easy access to that. The web.config contains an accesslist setting that is a comma delimited string of the IP addresses that can access the site. If this is not needed, then all you have to do is remove the SecurityHttpModule entry in the web.config or leave the entry on the Settings page blank.
I have updated this article to include a Windows service that will gather stats for each of the torrents. The installation of the service is very simple. The application can run as either a console application or as a Windows service. I came up with the idea from this Code Project article. To run it as a console application, run the application without any arguments. To run the application as a service, run it with a –service argument. To remove the service from the system, run the application with a –removeservice argument.
To install, extract the compiled binaries and the application configuration file to a directory. Set up the application configuration file as needed. Install the application as a service (run once with a –service argument) or setup a Task Scheduler task to execute the application without any arguments.
One last option to consider. The performance of the site can be greatly improved by setting the debug setting in the web.config to false. This is mainly due to the AJAX Control Toolkit and the difference in the scripts it sends to the client.
There are still some quirks, but overall, it gets the job done; whatever that may be!
Here is a list of some of the features of this project:
µtorrent, providing a simple Web interface that is accessible by most browsers.UpdatePanels by an AJAX Timer control.GridViews support paging and sorting from within the Update Panel.logviewer features a GridView with a neat feature - filtering. The distinct values of each column are displayed in a DropDownList in the column header that can be used to filter the data in the GridView.GridView, etc.) prefer attribute based, others (TreeView) prefer element based.None really yet. Comments and criticisms are welcome.
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 24 Jun 2008 Editor: Deeksha Shenoy |
Copyright 2008 by mattsrebatespam Everything else Copyright © CodeProject, 1999-2009 Web11 | Advertise on the Code Project |