Calling a vb script from a asp.net / C# webpage -


I have written an asp.net web page with C #, which runs the existing VB script.

The idea is that the user uploads an Excel spreadsheet (.xls) using a web page, checks a few basic things on the C # file (file type, file name etc.), then a network location Saves .xls at

C # then passes the network path of the .xls to the vb script, which obtains necessary information from .xls to create a .csv file.

Finally. A stored procedure has been passed in Csv and uploaded to a database table.

The problem is that when I run a webpage locally on my machine then it all goes completely. However, when I upload the page to the webserver, this vb script is not executed;

Some quick information:

  • Excel is installed on the web server
  • The website is set to execute the script and executable
  • The script is currently set to run in the form of 'me' (this will change) that is the administrator on the web server
  • If I run the script on the webserver using the CMD prompt < / Li>

I may be wrong, do not talk about it I appreciate the pain ... seriously, I am pulling my hair more than this one and will consider any idea, no matter how nuts ... but, and it is big, despite the fact that There are many other ways to get the same result, I am afraid that for many reasons this is the same I have to work with it :)

edit

< P> How do I call scripts here

  try {system} Security.SecureString password = new System.security.co.uk (;); String uspw = "mypassword"; Forex Currency (Four C in the Urp) {password.AppendChar (C); } Process script = new process (); ScriptProc.StartInfo.FileName = @ "cscript"; ScriptProc.StartInfo.Arguments = ScriptPath + "// Nologo" + UploadPath + xlsFileName; ScriptProc.StartInfo.WindowStyle = Process WindowStyle.Minimized; ScriptProc.StartInfo.UserName = "myusername"; ScriptProc.StartInfo.Password = Password; ScriptProc.StartInfo.UseShellExecute = false; ScriptProc.Start (); ScriptProc.WaitForExit (); ScriptProc.Close (); } Hold ...  

All file paths are relative.

When the script is called, the code is failing. You can clearly see the page to end the screenplay. However, if you do not see the task manager on the web server, then the CSAP or Excel starts to run.

I have also put a message box at the beginning of the script which is not displayed

2 edit It has been learned that the CSAP is running, I need to put the 'All Users' check box in the task manager ... I'm still not intelligent!

Looks like you use automation to control Excel application Are you yourself?

Some quick information:

  • Excel is installed on the web server

This is usually the one Bad idea, because the excel application is not an application whose purpose is to be automated by a server. Thing may be hanging because the app is waiting elsewhere for user input in a dialog. And it's not scalable to handle operations from multiple users simultaneously.

If the final goal is to extract the data from the excel file and put it in SQL Server, then I would like to suggest that you get the Jet ALLDB provider to get data from the Excel file, either from your web application , And allow this data to be stored in SQL Server, or allow SQL Server to do it directly if the Excel file contains a lot of data, then the best option may be


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -