Architecture :: Clicking A Button On A Webform Invokes A Command Line Program
Oct 17, 2010
I'm trying to create a webpage, that on clicking a button on a webform invokes a command line program like
ProcessStartInfo startInfo = new ProcessStartInfo(@"program.exe");
startInfo.Arguments = @"parameters";
The program takes about 3 secs or more to complete it's process running via command prompt. This creates a file that is then read by the next method morestuff(); My problem is that after Process.Start() it moves over to the method morestuff and the file is still not created and throws an error - file does not exist. How do I make sure that the process.start is complete before executing the method morestuff()?
Is there a recommended or good way to stream the output messages asynchonously to a web form so there's some indication of progress? A bit like TeamCity does for build scripts. Should I be polling a webservice? Using the OutputDataReceived event? Turning off buffering?
ave never used ajax.... I'm currently putting together a little web app that basically calls a program on the server itself (a command line tool) and displays the output to the web page.When the command line tool is run from the command line, it outputs status messages as it does it's thing... as it is now, my page just displays all the output when it's done. What I would like to do is show each line of output on the web page as they happen, just like when run from the command line. I'm guessing ajax is what I need... can anyone point me in the right direction for this specific scenario (user clicks button, output streams to web page as it happens without full page post backs)... a good example would be how ping.exe displays it's output on the command line
i am using vs 2008 and ajax when i execute my application i had this error messageCannot execute a program. The command being executed was "C:WINDOWSMicrosoft.NETFrameworkv3.5vbc.exe" /noconfig @"C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesestwebsite_componenteditor2842527e6911f45cp1uobvpm.cmdline".
I have an ASP.NET application running under IIS. I'd like to be able to change one of the web.config values in Application Settings. I know it's possible to change it programmatically as described in this answer but I'm wondering if the same thing can be accomplished from the command line.
The IIS 7 Manager allows application settings and connection strings (among other options) to be changed. My hope is there is a way to do the same via the command line for IIS 6 and/or 7.
I need to use Notepad to make changes to an old .Net 1.1 app. I then would like to use the command line compiler. the syntax (and where I need to navigate to in my cmd) to compile the changes I make in the code behind pages into the DLL?
i would like to do an automated test system which will allow me to run a batch file automatically. right now the procedure is:
i would like to have a button so that once the user clicks it, the above processes are ran automatically.i have something done, which allows me to open up cmd.exe as shown below:protected void Button1_Click(object sender, EventArgs.
I will start a new project in a couple of weeks and I have some questions about ASP .NET WebForms. Visual Studio ofters some nice wizards such as the SqlDataSource component that you can assign to a GridView and then you can edit and delete rows without coding.
The disadvantage of these wizards is the bad seperation between the layers and thereby the maintance of the software. One good example is the SQL statement in the view (*.aspx files) and so on. I would like to ask you how you handle this in your projects. Do you use the wizards? Otherwise if the wizard would not be used then it is a lot of effort necessary to program all features of the GridView component self. Such as edit, sort, paging etc. Is there information available how you can do this? I didn't find really something. What is your opinion about this.
We have a ASP .NET application which will be deployed in a web farm. We would like to find the total number of sessions that have been established. If we create a counter in global.asax.cs, it will be able to count only within aspnet_wp process. In a web farm, multiple nodes will have IIS on multiple machines. If we use SQL server-based session management, can we get the total number of active session by querying the Session DB? If we later decide to use session state server to store the sessions, can we get the number of active sessions?
I am trying to figure out how to publish a web app from a command line if there isn't a solution file present. Is this possible? Is it possible to generate a solution file from the command line? I would need example of how this is accomplished.
I'm trying to execute a .bat file in my web page when a user clicks a button. The normal command I would run in the command window is as follows. abc.bat 1 Where 1 is project number which is dynamically assigned according to the scenario in the program. Also the .bat file is inside the folder D:Test1. My code looks like this.....
When I run the .bat file the data should be generated for project and stored in a database. When I run this in command line it works fine. But when I run the above code in the asp.net web page it executes without any errors but does not store any values in the database. Have I defined the project name, arguments correctly in the above scenario?
I want to use SDelete after some code is run on an asp.net page. SDelete is a command line tool. My specific question is has anyone been able to run this SDelete from an asp.net page? More generic question would be, how do you run a command line utility from an asp.net page?
I was wondering if you should write code so that external classes and functions of that external class can access the webform controls in the main class???
Or should you only use the external class to process some data, return that data back to the main class (that instantiated that external class object) and then have an internal function in the main class to deliver the data to the control? (back to the screen)
I have a web page hosted on the server and a zip file on the server's file system. The page is spinning off the 7zip process with some arguments (location of the zip file and destination folder for unzipping) but it seems to raise permission issues, of course. For each file in the archive I get "Can not open file [filename]". I tried windows authentication and running the process with a username and password but nothing worked properly. What would be the best way for unzipping the file on the server from security point of view? Ideally, I would also like to have this event driven so the file is unzipped as soon as it arrives on the server (this is when I request the page).
I've been doing this project at work on a little app that we use for building and deploying websites to different customers. It works quite well, and we actually only have to press two buttons to have our DataProviders and DataRecords generated from sql and having our dll's compiled and everything sent to the customers ftp as a zip file, ready to unpack and use.
Now the problem is that since I've upgraded to Windows 7 (was XP) our compiler (either csc.exe or the msbuild.exe) seems to be messing with the codepage of our generated files. Resulting in æøå and characters alike are being converted to what seems to be ANSI encoding (this doesn't happen when running on XP).
I've been searching the net to find a viable solution to our problem and the only thing I have come upon is that the .NET framework version 4 has a parameter for codepage. Since we are using webdeploy build files on the 2.0 framework (and don't have time to roll our projects on to the next version framework) I would like to know if anyone has a quick remedy to resolve our problems with codepage.
I have a Perl script that calls aspnet_compiler.exe to compile a large ASP.NET website. The problem is that it takes very long to run. Is there any way to compile just a single .aspx file from the command line? (I think that would suit the needs of my script) It seems that all aspnet_compiler.exe can do is compile at a directory level.
I have several class files in App_Code in an ASP.net website running in Microsoft Visual Studio 2005 Professional.In liu of using a full unit test suite I just want to somehow compile those project-wide classses into an .EXE so that I can nightly run unit tests on them.I do know how to create a separate C# library project consisting of those files and how to include them into my website--but that is not desirable--I don't want to give up the ability to make on-the-fly code changes of those library classes when running the website in the debugger. As far as I know .Net debugger isn't powerful enough to modify code in included libraries with instant auto re-compilation on page re-load.So, I want my cake and eat it, too: Command-line unit testing of website class files in App_Code directoryBeing able to modify those class files w/o stopping/re-starting the web debugger.