Running a Perl Script in ASP.NET

Discussion in 'ASP .Net' started by Titof, Jul 23, 2003.

  1. Titof

    Titof Guest

    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.exe_
    c:\perl\diskquotas.pl -query -format csv e:_
    >c:\report\Quotas.csv")

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

    Public Function ExecuteApp(ByVal cmd As String) As String
    Dim output As String
    Dim errors As String
    'create a tempfilecollection for output and error messages
    Dim tf As New System.CodeDom.Compiler.TempFileCollection
    'execute the command
    System.CodeDom.Compiler.Executor.ExecWaitWithCapture(cmd,
    tf, output, errors)
    'read the file with the output of the command and return
    its content
    Dim sr As System.IO.StreamReader = 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
    Titof, Jul 23, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wet Basement
    Replies:
    1
    Views:
    2,505
    BobMonk
    Jul 15, 2003
  2. dpackwood
    Replies:
    3
    Views:
    1,772
  3. pj
    Replies:
    3
    Views:
    275
  4. Replies:
    4
    Views:
    177
    Josef Moellers
    Oct 27, 2007
  5. Replies:
    4
    Views:
    287
    ccc31807
    Jul 29, 2011
Loading...

Share This Page