Click here to Skip to main content
Click here to Skip to main content

WebDrive with ASP.NET (C#)

, 28 Mar 2004
Rate this:
Please Sign up or sign in to vote.
A virtual drive on the web with ASP.NET (C#), XML and debit control.

Sample Image - WebDrive.jpg


This article will present a full ASP.NET web application written in pure C#. You'll see how to upload a file, use XML to store and read configuration, control the bandwidth used by the web site and adjust it to your needs.

Using the code

Debit control code:

//prepare data, read the file
data = null;

    System.IO.FileStream fs = File.OpenRead(LocalServerPath + dlfile);

    data = new byte[fs.Length];

    fs.Read(data,0, data.Length);

catch(Exception ex)
#region Debit Control
//Debit control

if (wc.SpeedLimit == 0)
    blocksize = 2048;
    blocksize = (wc.SpeedLimit * 100);

while(index < data.Length)
    if (index < data.Length)
         s.Write(data,index, this.blocksize);
         index = index + blocksize;

    if (wc.SpeedLimit != 0)

How to install the demo?

  1. Download the file and unzip it where you want. Modify the 2 XML config files: WebDriveConfig.xml to specify the storage directory and Users.xml to create a login/password (there are 4 users by default).
  2. Right click on the folder where the webdrive is unzipped, click on properties, go to the web share tab, and share it with any alias name (webdrive for example).
  3. Open IIS in Control panel > administrative tools , open the default website, find the web share named webdrive and right click on it > properties, in the virtual directory tab, in front of application name, click on delete and after create, click OK.
  4. Open your web navigator (all navigators are supported because I don't use JScript or DHTML), type: http://localhost/webdrive, type your login / password.

Feel free to ask me any questions:

Joseph Benguira


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
France France
No Biography provided

Comments and Discussions

Questionmy vote is 5 Pinmembermuhamd yusuf17-Jan-12 1:51 
QuestionHow to publish my website PinmemberElaaber2-Jun-09 15:36 
GeneralWorking with Microsoft Visual Web Developer 2008 Pinmemberadale196028-Apr-09 5:10 
Generalupload file more than 10 GB PinmemberNetKing2-Sep-08 5:36 
GeneralRe: upload file more than 10 GB Pinmemberjocool25502-Sep-08 5:56 
GeneralIIS Pinmemberyousefk6-Nov-07 22:29 
GeneralRe: IIS Pinmembersuresh_kumar_s30-Oct-09 3:11 
GeneralIt is really a good job ... thank you ... PinmemberMohammed Jabr27-Oct-07 23:45 
GeneralAdmin PinmemberJuveko17-Jun-04 5:48 
GeneralRe: Admin Pinmemberjocool255017-Jun-04 23:02 
GeneralRe: Admin Pinmemberjocool25506-Jul-04 2:01 
QuestionRe: Admin PinmemberDarren Fitzgibbon5-Sep-08 7:06 
AnswerRe: Admin PinmemberMadvayne16-Feb-09 3:25 
Generalany Idea how I can get the filesize Pinmembergrashupfer7-Apr-04 0:48 
GeneralRe: any Idea how I can get the filesize Pinmemberjocool25507-Apr-04 2:07 
GeneralRe: any Idea how I can get the filesize Pinmembergrashupfer7-Apr-04 2:48 
GeneralRe: any Idea how I can get the filesize Pinmemberjocool25507-Apr-04 3:18 
GeneralRe: any Idea how I can get the filesize PinsussAnonymous7-Apr-04 22:24 
GeneralError When Following Setup Instructions PinmemberRabidKangaroo30-Mar-04 13:15 
GeneralRe: Error When Following Setup Instructions Pinmemberjocool255030-Mar-04 21:56 
GeneralLooks nice, but... PinmemberMatt Newman29-Mar-04 6:34 
GeneralRe: Looks nice, but... Pinsussjocool255029-Mar-04 22:48 
GeneralFeel free to ask me questions Pinsussjocool255029-Mar-04 1:18 
GeneralRe: Feel free to ask me questions PinmemberJuveko12-May-04 2:38 
GeneralRe: Feel free to ask me questions Pinmemberjocool255012-May-04 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150224.1 | Last Updated 29 Mar 2004
Article Copyright 2004 by jocool2550
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid