473,473 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem with process..

37 New Member
Hi All,

I am using process class to do some processing with the files and close the process.

it works fine but the problem is it is emptying all the session value which i am assiging before running the process.

Below is the Code:

Expand|Select|Wrap|Line Numbers
  1. Dim myProcess As Process = New Process()
  2.                 Dim sArguments As String = sProductID & " " & Chr(34) & sLicenseFile & Chr(34) & " " & Chr(34) & sApplicationPath & "metaconfig.txt" & Chr(34)
  3.                 Dim sFileName As String = Chr(34) & sApplicationPath & "license.exe" & Chr(34)
  4.  
  5.  
  6.                 myProcess.StartInfo.FileName = sFileName
  7.                 myProcess.StartInfo.Arguments = sArguments
  8.                 myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
  9.                 myProcess.StartInfo.CreateNoWindow = True
  10.                 myProcess.Start()
  11.                 myProcess.WaitForExit(1000)
  12.  
  13.                 If Not myProcess.HasExited Then
  14.                     myProcess.Kill()
  15.                 End If
  16.  
  17.                 myProcess.Close()
  18.                 myProcess = Nothing
  19.  
  20.                 System.Threading.Thread.Sleep(1000) 
how to solve this problem. can u tell me any solution.

Thanks

-John
Oct 14 '08 #1
7 1226
joedeene
583 Contributor
You are calling the .WaitForExit() method before you try to close it, it seems. Well, the .WaitForExit() method is to be called after the .Kill() method

Quote from MSDN
Note:
The Kill method executes asynchronously. After calling the Kill method, call the WaitForExit method to wait for the process to exit, or check the HasExited property to determine if the process has exited.
So, just try the Process.Kill() first, and then the Process.WaitForExit(). without the .close() or anything and just try that. Also, please use CODE[#] tags, when posting with more than a line of code. Please take the time to read the Posting Guidelines. And let me know if that works for you...

joedeene
Oct 14 '08 #2
john20
37 New Member
You are calling the .WaitForExit() method before you try to close it, it seems. Well, the .WaitForExit() method is to be called after the .Kill() method

Quote from MSDN
Note:


So, just try the Process.Kill() first, and then the Process.WaitForExit(). without the .close() or anything and just try that. Also, please use CODE[#] tags, when posting with more than a line of code. Please take the time to read the Posting Guidelines. And let me know if that works for you...

joedeene
Hi Joedeene,

Thanks for your reply.
Tried above solution but didn't help.
Is there any other way to solve this problem.

Thanks
-john
Oct 14 '08 #3
Plater
7,872 Recognized Expert Expert
What session values are you refering to? I don't see any in the code you posted?
What is the actual problem?
Oct 14 '08 #4
john20
37 New Member
What session values are you refering to? I don't see any in the code you posted?
What is the actual problem?
Thanks for your reply.

In the page load i am calling above function and assiging value to session variable.
like Session("Valid") = "True"

after loading this page i am redirecting the page to another page and there i am checking the session value but it is showing empty value.

Thanks again
Oct 14 '08 #5
Plater
7,872 Recognized Expert Expert
That is normally a browser issue, or an issue of code flow not being what you think it is.

The webpages are on the same application though yes?
Oct 14 '08 #6
john20
37 New Member
That is normally a browser issue, or an issue of code flow not being what you think it is.

The webpages are on the same application though yes?

Yes pages are on the same application.
Oct 14 '08 #7
Plater
7,872 Recognized Expert Expert
What exactly does the relatable code look like?
I am guessing that your browser is just not sending the session value (security settings rejecting it), but its possible the Session value never gets set in the first place.
Oct 14 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: thomas-lists | last post by:
Hey folks, before posting to the bugs-list I would like to try it here to get some help :). Every now and then MySQL-4.0.13 crashes on my Dual-Athlon-MP-machine. Its not reproducible nor I know...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application...
1
by: Primo | last post by:
Hello, I am building a data management application with the following processes: Process 1 is a Windows service which uses FileSystemWatcher to monitor a directory. Process 2 opens a file...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
7
by: WALDO | last post by:
I wrote a console application that basically consumes arguments and starts other command line apps via System.Process. Let's call it XCompile for now. I wrote a Visual basic add-in that does pretty...
1
by: Steven M. | last post by:
Greetings... I need desperate help with my problem. I guess the solution is related in some way with the cookies getting lost in the authentication process working with some web servers. ...
5
by: LRK | last post by:
Earlier this week we set up a second application pool to be able to implement trusted connections between ASP.NET apps and a SQL Server database on a different server. The trusted connection is...
5
by: Benzi Eilon | last post by:
I have written a C# application which should run as a Windows Service. I must avoid having multiple instances of the application on one machine so I inserted the following code at the beginning of...
11
by: garyusenet | last post by:
For this first time today I used the System.Diagnositcs namespace to launch a program from my c# code. The program launches OK but I have something which has completely stumped me. The...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
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...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.