ASP .NET Demo
This is a simple web application example to show how ASP .Net works.
This description is also available in plain text file here.
Development Environment: Microsoft ASP .Net Web Matrix / Window XP
Development Language: VB, C#
Function Description:
User can log in the system using UserID and password. New userID can be created by registration.
After log in, user can browse project information, submit and retrieve files to and from existing
projects. User with administrator position can create new projects.
Platform and Tools Installation:
(following operations are suitable for windows XP. Please note the
order of installation is important. Midorder can result failure in the
application)
- install IIS
Control Panel -> add or remove programs, choose
add/remove windows components. In Windows Components Wizard window,
check Internet Information Services and then follow the wizard.
(Windows XP CD or any disks contain I386 directory is needed.)
- install Microsoft .NET Framework Version 1.1 Redistributable Package
It can be downloaded here
- *install ASP.net Web Matrix
(This installation is optional. It is only useful if you want to
modify or develop the source code by yourself. )
It can be downloaded here.
Download and install "File Management" web application
- download file fileManagement.zip, unzip it to any directory,
e.g. C:\myWeb.
A subdirectory named "fileManagement" will be created automatically.
In the following we willuse %unzippath% denote the unzip directory.
i.e. here %unzippath% = "C:\myWeb"
modify the web.config file.
You can find this file under %unzippath%\fileManagement. Open it using notepad. Modify the value of key
"fileManagementRootPath" to %unzippath%\fileManagement\
e.g.
find
<appSettings>
<add key="fileManagementRootPath" value="E:\dotNetSpace\fileManagement\"/>
</appSettings>
in the file web.config, change it to
<appSettings>
<add key="fileManagementRootPath"
value="C:\myWeb\fileManagement\"/>
</appSettings>
save the file and close it.
Publish the web application:
- In Control Panel-> Administrative Tools, find "Internet Information Services" icon.
- Double click it, find Internet Information Services -> Your Host name -> Web Sites-> Default Web Site.
- Right click Default Web Site, choose new->Virtual Directory
- Follow the wizard, in Aliase field, give a name of the webside
(This name is used for access your website. e.g. type fileManagement here, your website
can be accessed at http://localhost/fileManagement or http://yourhostIP/fileManagement)
- In directory fild, browse to directory %unzippath%\fileManagement\
- Following the wizard to finish
After publishing, you can find a sub Web named fileManagement under Default
Web Site right click fileManagement, choose Properties. In the file Properites
window, in tab Virtual Directory, be sure both Read and Write boxes are checked.
Under Documents tab, check Enable Default Document box, add "login.aspx" into
default documents. Click ok to close it. In IIS window, choose Default Web Site,
stop and restart it.
Now you can access your web site at http://localhost/fileManagement
on your local machine or at http://yourhostIP//fileManagement from other
computer.
Note:
- If register or project creation function cannot work, it may becuase you didn't assign
NTFS permission to the web account in the file system.
You can fix this by right click the fileManagement directory in Windows Explore,
choose properties. In Security tab, add Everyone and allow full control.
Note: this can be reduced to several accounts. But I haven't figured out which
accounts are associated with this. Only add Internet Guest Account is not enough.
If cannot find security tab in the properties window, go to Folder Options in
Windows Explore -> Tools -> Folder Options. In View tab, scroll down to the
bottom and uncheck Use simple file sharing(Recommended). Click ok and reopen the properties
window of fileManagement directory, you will find the Security tab.
- Only administrator has the right to create a project. Therefore, the create
project button can only be seen when user login as an administrator.
- Since the user accounts and projects infomation is stored in XML files,
creating users and projects can easily be done by directly modifying the XML files. However,
this is not recommended. Because it may result unexpected operation if the modification
doesn't strictly follow the XML schema. It is better to use the register and create function
provided in the application.
- You can also run the web application without IIS if it is not available on
your computer and if you have Web Matix installed. But in such a case, the application is running
on a virtual web server which is only accessible locally. That means your web cannot be
accessed from other computers. For more detail, please refer to Web Matrix guided tour.
http://www.asp.net/webmatrix/guidedtour/getstarted/intro.aspx