Async Thread To Run Executable

Nov 16, 2011

I have a page which has populated a database with a set of information that needs to be processed. This could take a considerable amount of time and I want it to run in the background, mean while I will have my web app display a page with an intermittent meta refresh showing me progress of the records in the DB being processed.

What I think I need to do is start an executable, in a different thread running in the backgound on the server which will run until it is complete, without interfering with other web activity.

Can this be done? Do I start it in a different thread? How can I start the exe in that thread and just leave it to do its work?

View 2 Replies


Similar Messages:

C# - Async Function Thread.Sleep In Web Application?

Sep 8, 2010

I maintain a ASP.NET web application that causes a user's network connection to reset for several seconds when it executes a procedure. Therefore, the page request times out on the user's end as they never receive the web application's response (the connection dies before it gets the response packet).

To resolve this situation, I was contemplating having the ASP.NET page execute an asynchronous function that incorporates a Thread.Sleep(5000); // sleep for 5 seconds before executing the connection reset This way, the browser has 5 seconds to receive the page's response before their connection resets.

I have concerns with using Thread.Sleep and asynchronous functions in ASP.NET though. I've never attempted to do it before, so I'm unsure of the potential problems it may cause. Does anyone see potential problems with starting an asynchronous thread that contains a Thread.Sleep in an ASP.NET application?

View 3 Replies

Cross-thread Operation Not Valid: Accessed From A Thread Other Than The Thread It Was Created On

Apr 2, 2010

I want to remove checked items from checklistbox (winform control) in class file method which i am calling asynchronously using deletegate. but it showing me this error message:-

Cross-thread operation not valid: Control 'checkedListBox1' accessed from a thread other than the thread it was created on.

i have tried invoke required but again got the same error. Sample code is below:

[code]....

View 1 Replies

Visual Studio :: Debug A Multi Thread Program To See Local Variables Of Each Thread Using 2008

Jan 27, 2010

How can we debbug a multi-thread program to see local variables of each thread using visual studio 2008.

View 1 Replies

Architecture :: How Can Thread Update A Variable Shared With The Main Thread

Nov 24, 2010

I'm new to threading and have used it successfully, but limited. I can spawn a thread and have the main thread reference variables in the spawned thread, but I don't know how to allow the spawned thread to reference (and update) variables in the main thread.

Any example threading code I've seen on the web appears to be WAY more complicated than what I do, so I am unable to understand or integrate into my code.

Here is a quick example of how I use threading:

[code].....

View 3 Replies

What Are The Differences Between Currently Executing .NET Thread And Win32 Thread

Mar 24, 2010

I am reading the Asp.net security documentation on msdn.I come across these tow terms and get really confused.

# WindowsIdentity = WindowsIdentity.GetCurrent()

which returns the identity of the security context of the currently executing Win32 thread.

# Thread = Thread.CurrentPrincipal

which returns the principal of the currently executing .NET thread which rides on top of the Win32 thread.

View 1 Replies

C# - Lock Thread.sleep Not Working With .NET Thread?

Jun 25, 2010

I have a password page and when someone enters an incorrect password I want to simply foil a brute force attack by having

bool isGoodPassword = (password == expected_password);

lock (this)
{
if (!isGoodPassword)
Thread.Sleep(2000);
}
I would expect that this would allow all correct passwords without stalling, but if one user enters a bad password another successful password from a different user would also be blocked. However, the lock doesn't seem to lock across ASP.NET threads.

View 4 Replies

Web Forms :: Use Thread.sleep Method For A Particular Thread?

Aug 27, 2010

I want a example of multithreading .i want to use it in a web form not on console.i am using C#.net .and how to use thread.sleep method for a particular thread.

View 5 Replies

Calling An Executable From Web Page

Dec 21, 2010

I want to call an Executable from a Web Page. I used the following code :

System.Diagnostics.Process.Start("c:\WINDOWS\system32\notepad.exe");

Works fine when executing (debugging) from Visual Studio. But when deployed as a website on IIS, the UI of the Notepad application is not seen. As it is executed as an anonymous user (Network Service in IIS 6.0) it is seen in task manager but cannot be seen as an executing application.

So now I applied Impersonation :

Code file (ASPX.cs File)
System.Security.Principal.WindowsImpersonationContext impersonationContext;
impersonationContext = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
System.Diagnostics.Process.Start("c:\WINDOWS\system32\notepad.exe");
impersonationContext.Undo();
(Web.Config)
<authentication mode="Windows" />
<identity impersonate="true" userName="DomainUserName" password="password" />

In the application's virtual Directory in IIS go to properties and go to Directory Security Tab. In the Authentication and access controlclick Edit. Default Settings are: Enable anonymous access and Integrated Windows authentication are checked. This will give the following Error : An anonymous identity cannot perform an impersonation......................

View 5 Replies

Calling An Executable File From Web Server

Nov 20, 2010

i am working on a project where i have to give call to an .exe file to access the scanner on client side. i am using System.Diagnostics.Process.Start(Server.MapPath("~/bin/Scan.exe").ToString()"); to call exe file in my bin folder on to the server, but it is not getting called.

View 4 Replies

Converting Project Into Executable (.EXE) File

Mar 6, 2010

does someone know the utility/procedure for converting an ASP.net project containing multiple files into one executable (.EXE) file?

View 3 Replies

Running Executable Asynchronously From Web Application?

Apr 13, 2010

What are the alternatives to System.Diagnostics API for running external EXE or BAT files under IIS hosted web application?

I would like to run external EXE program from my ASP.NET-MVC web application. I don't need to wait till the program exits. I just want to start the program. The execution can take some time or it may crash, so I would like to run it separatelly from IIS in such a way that the web application only triggers its execution.

View 1 Replies

Web Services Deploy As A Single Executable File

Oct 22, 2010

I have developed multiple WebServices in my project in ASP.NET. Now I need to deploy them as a single executable file. How can i do that?

View 1 Replies

Launching External Executable In Windows Azure?

Jul 15, 2010

My current ASP.NET site requires to launch FFMPEG.EXE to convert uploaded videos. With shared web hosting server, can't be done but via a Virtual Private Server (VPS) or a dedicated server.

I've been reading some info about Windows Azure but haven't found any info regarding:

1. Be able to launch external executable

2. Be able to remote desktop into the allocated virtual machines

View 1 Replies

C# - Get The Path For Executable File That Started The Application?

Feb 3, 2010

i am working on a web application using C#,

i know that in window application how to give the path for executable file that started the application (if (!System.IO.File.Exists(Application.StartupPath + "gsdll32.dll")))

but i dont know how to give that path in web application using c#

View 2 Replies

Security :: Block A Executable File From Upload?

Apr 6, 2010

I'm doing a project in component management system. I need to block executable files from getting uploaded. Blocking should not be based on the extensions. For example, i've a file named abc.exe i'm going to change the file extension to abc.jpg in this case that abc file should not get updated. Similar to that in gmail file attachment.

View 2 Replies

Security :: Block An Executable File From Upload?

Feb 28, 2010

I'm doing a project in component management system. I need to block executable files from getting uploaded. Blocking should not be based on the extensions. For example, i've a file named abc.exe i'm going to change the file extension to abc.jpg in this case that abc file should not get updated. Similar to that in gmail file attachment.

View 1 Replies

C# - How To Get Common Library To Read App.config Of Current Executable

Apr 28, 2010

I have a common library and two executables. Each executable refers to the common library for some functionality. I would like the common library to read from the app.config of the exe which is currently running. Is there specific API calls to do this?

View 1 Replies

Visual Studio :: Compiler Executable File Csc.exe Cannot Be Found?

Feb 9, 2011

I formatted my system which has Windows XP serive pack 2 and after that Installed the VisualStuido 2008 setup.But,when I run any website then it says

Compiler executable file csc.exe cannot be found. Description: An unhandled exception occurred during the execution of the current web request.

I searched but could not find any suitable soution for it.Before formatting .Net was working quite fine.

It only work if I change version value to 2.0 from version=3.5 in webconfig file

<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>

Kindly reply I wasted whole day for it but could not get the way for it.

View 1 Replies

C# - Differentiate Whether A Managed Library Is Running In The Context Of Application Or In A Executable?

Mar 24, 2010

how to differentiate whether a managed library is running in the context of asp.net application or in a executable?

View 2 Replies

C# - Creating An Executable Script Which Accesses Aspx Form Components And Runs Function?

Jul 28, 2010

I have created and application which contains a gridview that is populated by an SQL database. I built a function which converts the gridview into an excel file and stores it on the server.

I would just like to know how I can write an executable script(which I will set to run at a certain time on the server) that will access the gridview in the .aspx file containing the gridview and run the convertToExcel() function located in the .cs file attached to the .aspx file and then close.

View 1 Replies

SQL Server :: Project Executable Can't Connect With Database Unless Installing SQL Server

Nov 7, 2010

I am developing and app to find automatically characters stats with the 2nd edition dnd rules to be easy for my party to create characters when we play.

I am using Visual studio 2010 c sharp express and Sql 2008 express R2.I have added a database in the project to have all the data needed. When I use the release folder or the debug folder on other pcs the app doesn't run. Wherever I install SQL server (database and management) things are fine. I googled but I am not sure what to look exactly for and made a brief search here but with no results. I am trying to make sth that has almost no dependencies but well I can't avoid installing .net framework 4 everywhere...

Is there anyway to make database work without installing SQL? Is there any workaround like a dll or sth?

View 5 Replies

C# - How To Invoke An Executable Desktop Application From Within An Application

Feb 18, 2011

I have finished developing an executable desktop application to generate a fractal image based on the passed-in arguments. The output type is JPEG.Now I am developing a site under ASP.NET MVC 3. I want to use the executable from within my site.

Is it possible to use it as is without converting it to a class library and recompiling?

View 3 Replies

MVC :: Where The Async Method Has Arguments?

Jun 5, 2010

I have a MVC project in a test environment with an AsyncController. I have a pair of methods, ...Async and ...Completed and it seems to work well.The thing is that I've seen examples where the Async method has arguments such as....

public void IndexAsync(AsyncCallback callback, object state)

In my project that defintion yields "No parameterless constructor defined for this object." When I remove the arguments like this...

public void IndexAsync()

it runs fine. I'd like to explore some examples that use these arguments. Where do they come from? How can I get them...

View 2 Replies

Queuing Requests / Async Processing?

Oct 28, 2010

I'm putting together a web app that will process time consuming jobs in the background.so for example 100 users are on the site 20 of them submit jobs to the server. these 20 jobs get added to a list and the background worker pickes them up one by one. I want to be able to have up to 10 background workers doing the tasks.

for scaleability the job list is likely to be a database table, however at the proof of concept stage I will probably use an application variable (stack of some sort) with a GUID to identify each job.

So I *think* what I need is ....

a single background worker process that starts when the web app starts.This process monitors the stack / job list. It dynamically creates a worker process for the first item, removes the job from the stack and increments the thread count.If there is a second job it creates another thread (up to 10) and increments the thread counter.When each thread finishes it closes itself and decrements the thread count.
If I move to the database table job list would it be better to have ASP.Net add jobs and a windows service do the processing?

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved