Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 14th, 2006, 08:03 AM
Registered User
 
Join Date: Jan 2006
Location: lahore, punjab, Pakistan.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Process.Kill() online problem

i am getting process's information in web application its working fine at local (my machine) but when i doploy it i face exception on function calling Quitter(ProcId) here is my code


            Dim ProcId As Integer = 0
            Dim Process1() As Process = Process.GetProcesses()
            Dim xApp As New Excel.Application
            Dim Process2() As Process = Process.GetProcesses()

            Dim i, j As Integer
            Dim bMonProcessXL As Boolean
            For j = 0 To Process2.GetUpperBound(0)
                If Process2(j).ProcessName = "EXCEL" Then
                    bMonProcessXL = True
                    ' Parcours des processus avant le mien
                    For i = 0 To Process1.GetUpperBound(0)
                        If Process1(i).ProcessName = "EXCEL" Then
                            If Process2(j).Id = Process1(i).Id Then
                                ' S'il existait avant, ce n'était pas le mien
                                bMonProcessXL = False
                                Exit For
                            End If
                        End If
                    Next
                    If bMonProcessXL = True Then
                        ' Maintenant que j'ai son Id, je pourrai le tuer
                        ' xlApp.Hinstance ne fonctionne pas avec Excel 2000
                        ' alors que cette méthode marche toujours !
                        ProcId = Process2(j).Id
                        Exit For
                    End If
                End If
            Next

            Quitter(ProcId)

Public Sub Quitter(ByVal ProcId As Integer)
        If ProcId = 0 Then Exit Sub
        Process.GetProcessById(ProcId).Kill()
    End Sub

on calling Quitter(ProcId) exception is occuring "couldn't get process information from remote machine ".this exception is occuring online. at local its working fine

Have a look on exception:

ERROR MESSAGE:-->Couldn't get process information from remote machine.
EXCEPTION.TOSTRING MESSAGE:-->System.InvalidOperationException: Couldn't get process information from remote machine. ---> System.Threading.ThreadAbortException: Thread was being aborted.
   at Microsoft.Win32.UnsafeNativeMethods.RegQueryValueE x(HandleRef hKey, String lpValueName, Int32[] lpReserved, Int32[] lpType, HandleRef lpData, Int32& lpcbData)
   at System.Diagnostics.PerformanceMonitor.GetData(Stri ng item)
   at System.Diagnostics.PerformanceCounterLib.GetPerfor manceData(String item)
   at System.Diagnostics.PerformanceCounterLib.get_Categ oryTable()
   at System.Diagnostics.PerformanceCounterLib.GetPerfor manceData(String[] categories, Int32[] categoryIndexes)
   at System.Diagnostics.NtProcessManager.GetProcessInfo s(PerformanceCounterLib library)
   --- End of inner exception stack trace ---
   at System.Diagnostics.NtProcessManager.GetProcessInfo s(PerformanceCounterLib library)
   at System.Diagnostics.NtProcessManager.GetProcessInfo s(String machineName, Boolean isRemoteMachine)
   at System.Diagnostics.ProcessManager.GetProcessInfos( String machineName)
   at System.Diagnostics.Process.GetProcesses(String machineName)
   at System.Diagnostics.Process.GetProcesses()
   at MysteryShoppingTechnologies.clsDataBase.uploadMSPD ata(String FilePath, Int32 MSPId)
STACK TRACE:--> at System.Diagnostics.NtProcessManager.GetProcessInfo s(PerformanceCounterLib library)
   at System.Diagnostics.NtProcessManager.GetProcessInfo s(String machineName, Boolean isRemoteMachine)
   at System.Diagnostics.ProcessManager.GetProcessInfos( String machineName)
   at System.Diagnostics.Process.GetProcesses(String machineName)
   at System.Diagnostics.Process.GetProcesses()
   at MysteryShoppingTechnologies.clsDataBase.uploadMSPD ata(String FilePath, Int32 MSPId)



if any one can solve this problem
thanx in advance

khizar ,lahore,pakistan

  #2 (permalink)  
Old October 4th, 2006, 11:31 AM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi khizar

I have the same issue like you. Can you sorted out ?

I would appreaciate any information about it.

Kind Regards

M. Duverger

  #3 (permalink)  
Old October 12th, 2006, 09:08 AM
Authorized User
 
Join Date: Jun 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi guys,

can u just send the source code(with events) because i was jst wondering wat exactly are u trying to achieve.By wat u hv written i guess there is some problem with security but still i am also not quite sure.

Rgds

  #4 (permalink)  
Old October 30th, 2006, 12:07 AM
Authorized User
 
Join Date: Feb 2006
Location: Bangalore, Karnataka, India.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to karthiklsimha
Default

Hi,

The reason may be with directory security settings for the virtual directory. Usually only Power Users or Administrators will be able to get the system resources information. Usually user IUSR_[SystemName] is used to impersonate in the remote machine. Try changing the directory security settings and give some user belonging to the power users group or administrators group. This may solve the problem.


Regards,
Karthik Simha


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with process.. nelly78 .NET Framework 2.0 3 October 14th, 2008 05:54 AM
Kill all winword.exe process before opening Word mckly Pro VB Databases 1 March 6th, 2008 01:34 AM
process of online payment rahulcbr Beginning PHP 3 January 30th, 2007 12:21 AM
Process problem wslyhbb C# 2 February 14th, 2006 01:48 AM
MyConnection.Close does not kill process busher ASP.NET 1.0 and 1.1 Professional 9 January 13th, 2006 06:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.