473,799 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running a Perl Script in ASP.NET

Hello,

i want to create an active webpage that displays the
status of users quotas on a volume of a server.
I installed IIS on this server and installed Win2k server
Resource Kit because the Perl script "DiskQuotas .pl"
exactly doing what i want.
I created a function (see below) that running the script
in a dos-command mode... BUT nothing happens :((
please help me
My asp.net function is :

Private sub page_load(....)
'First time, i tried this
Label2.Text = ExecuteApp("c:\ perl\bin\perl.e xe_
c:\perl\diskquo tas.pl -query -format csv e:_
c:\report\Quot as.csv")

'Second time..... i put the entire command line in a bat
file
Label2.Text = ExecuteApp("C:\ quotas.bat")
end sub

Public Function ExecuteApp(ByVa l cmd As String) As String
Dim output As String
Dim errors As String
'create a tempfilecollect ion for output and error messages
Dim tf As New System.CodeDom. Compiler.TempFi leCollection
'execute the command
System.CodeDom. Compiler.Execut or.ExecWaitWith Capture(cmd,
tf, output, errors)
'read the file with the output of the command and return
its content
Dim sr As System.IO.Strea mReader = System.IO.File. OpenText
(output)
ExecuteApp = sr.ReadToEnd
sr.Close()
'Delete the temporary files
System.IO.File. Delete(output)
System.IO.File. Delete(errors)
End Function

Nov 17 '05 #1
0 3703

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

Similar topics

0
2035
by: Fabio | last post by:
Hello, there's something I'd like to understand... I want to connect to the MS SQL Server database, get some records, store them into the text file, send the file through VPN connection and then send the email message about the task success or failure. First steps are quite easy but using the VPN connection makes me feel powerless... How can I start the VPN client from the Perl script?
6
10529
by: Pierre-Yves | last post by:
Hello, I would like to prevent my perl program to be executed several times simultaneously (if the program is already running, I would like to display a message like "another instance of this program is already running, please try again in a couple of minutes). For doing this, I guess I have to check the running processes... but I don't know how to do that and how I can identify my program in the running processes.
5
1760
by: Hal Vaughan | last post by:
Is there a way to run a Perl script WITHOUT submitting a form? I want to be able to click an "update" button on a page and have it run a Perl script to update info, without changing the document in the browser. Is there any way to do that and leave the current page intact in the browser? Thanks! Hal
10
2565
by: shumaker | last post by:
I don't need a detailed description of a solution(although I wouldn't mind), but I am hoping someone could tell me in general the best path to go about accomplishing a task, since I don't know all the capabilities of what I have available. I can learn the details myself I think. I am trying to set this up to be as simple to use as possible since others will be importing data on a weekly or daily basis. I need to import some text files,...
3
4137
by: sir.linying | last post by:
My php script is to call perl scipt which makes use of Spreadsheet::ParseExcel module to parse Excel file. I am able to launch php script from command line so that perl script can run and properly parse Excel file. However, when I put php script on server side and then launch php through client request, perl program can't run. Anyone has any suggestion re how to fix this problem? Thanks a lot, -Ying
4
3759
by: benwylie | last post by:
I am running IIS 6.0 on Windows 2003. I would like to be able to run a perl script from a web page and include the output. I have tried doing it with an ssi: <form action='docsearch.shtml' method='get'> <!--#exec cgi="/cgi-bin/docsearch.pl--> </form> This correctly ran the script, but it was unable to include the
2
2126
by: carllucas | last post by:
I have no exprience with perl. What I'm trying to do is have a script/program constantly (perpetually) running on my server so that it performs a routine (like every hour) and automatic check of something like the current weather in Tokyo and records it. The catch is that I want this to be done back-end and automatically without someone having to go onto the website and doing a "check" or something. This would mean that the script must be...
1
2318
by: Tension | last post by:
Hi. I have a Perl script that starts a build process (plus a lot of other things). The build process needs a few environment variables set. This is done automatically in a buildEnv.bat script supplied by the build system vendor. My first idea was to write a .bat scrpt that first calls the buildEnv.bat script and then calls the perl script. This does not seem to work since the perl script never executes. The .bat file looks like this: ...
6
3223
by: aravindtn | last post by:
i have a netwok,and i have a perl script running on a machine(say machine1). the purpose of the script is to login to each of the other machines using ssh. i am able to logon to other machne (say machine2) byusing the following code system("ssh <host_ip>"); after loging on to the network i need to run another perl script that is saved on the machine2. i want it to be done from the perl script running on machine1. i tried to do it by...
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.