473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

command line

BW
How in Asp.net do you run a command line program.

ex. I have a form that allows users to upload files to a directory on the
webserver. If they upload a zip file I want to automatically extract the
files from it. I am very new to ASP programming.

Thanks
BW
Mar 16 '07 #1
2 1667
Running a command-line is not something you would really want to do. Your
web host probably won't let you either. To use the command-line you would
need to grant permissions to the ASP.Net engine to do way more than the
asp.net user account should, which is most definitely a no no. Not to
mention most of the tasks you would perform were not designed for being run
from a web-application

Now, since you mentioned a zip file and needing to extract the files, first
thing that you should ask is "where could I find this functionality". If you
go by this approach you can begin to look for ASP.Net capable components
that will perform your task from within ASP.Net. You're in luck though, this
is a fairly easy task. There's an excellent open-source library called
sharpzip that could very well do what you need. Check them out at:
http://www.icsharpcode.net/OpenSource/SharpZipLib/

When looking for components don't forget to look at the component section of
www.asp.net (under resources), www.411asp.net, and of course
www.sourceforge.net
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"BW" <ba****@hotmail.comwrote in message
news:u$****************@TK2MSFTNGP04.phx.gbl...
How in Asp.net do you run a command line program.

ex. I have a form that allows users to upload files to a directory on the
webserver. If they upload a zip file I want to automatically extract the
files from it. I am very new to ASP programming.

Thanks
BW

Mar 16 '07 #2
On Fri, 16 Mar 2007 12:09:37 -0500, BW wrote:
How in Asp.net do you run a command line program.

ex. I have a form that allows users to upload files to a directory on the
webserver. If they upload a zip file I want to automatically extract the
files from it. I am very new to ASP programming.

Thanks
BW
You have a couple of options
1) You can use Process.Start to invoke a process to run a command line
utility, which you can then pass the zip file name to unzip your files e.g
2) You can write a small bit of code using the excellent SharpZipLib to do
this as well

#1 is the simpler option but may be problematic with hosted environments,
especially windows hosted environments, because by default windows does not
have a command line unzip utility
--
Bits.Bytes
http://bytes.thinkersroom.com
Mar 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Joe | last post by:
I'm using Python 2.4 on Windows XP SP2. I'm trying to receive a command line argument that is a newline (\n) Here is the command line to use sample.py "\n" Here is a sample.py script
7
by: Steve M | last post by:
I'm trying to invoke a Java command-line program from my Python program on Windows XP. I cannot get the paths in one of the arguments to work right. The instructions for the program describe the...
4
by: lkrubner | last post by:
I'd like to write a PHP script to be used from the command line on a Unix machine. I'd like for the script to put together a string, turn it into a web page, print it, then return control the...
5
by: randyelliott | last post by:
Good Day, I have a MS Access (Access 2000 now upgraded to 2003) database that tracks customer information. One function of this database is to create an encrypted license file for our software,...
34
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
3
by: Double Echo | last post by:
Hi all, I'm using PHP 4.4.2, and use PHP on both the command-line and the web. I am running PHP on SuSE 10 Linux , in a VMware 5.5 workstation, using Apache 2.0.55 , on my Dell laptop. ...
4
by: Bit byte | last post by:
I have a project that I normally build (without problems) from the DevStudio IDE. However, I have embarked on automating all my builds (this test project being one of several). The project...
2
by: Jim | last post by:
Hello, I need a program that will traverse a directory tree to ensure that there are unix-style line endings on every file in that tree that is a text file. To tell text files from others I...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.