zoukankan      html  css  js  c++  java
  • 利用宏自动附加到WebServer进程

    如果你像我一样经常需要利用"attached to process "来完成对网站应用程序的调试,那么你可能需要下面的宏来节省一点时间。

    01:  Imports System
    02: Imports EnvDTE
    03: Imports EnvDTE80
    04: Imports EnvDTE90
    05: Imports System.Diagnostics
    06:
    07: Public Module Debugger
    08: Public Sub AttachToWebServer()
    09:
    10: Dim AspNetWp As String = "aspnet_wp.exe"
    11:
    Dim W3WP As String = "w3wp.exe"
    12:
    13:
    If Not (AttachToProcess(AspNetWp)) Then
    14: If Not
    AttachToProcess(W3WP) Then
    15:
    System.Windows.Forms.MessageBox.Show(String.Format("Process {0} or {1} Cannot Be Found", AspNetWp, W3WP), "Attach To Web Server Macro")
    16: End If
    17: End If
    18:
    19: End Sub
    20:
    21: Public Function
    AttachToProcess(ByVal ProcessName As String) As Boolean
    22:
    23: Dim
    Processes As EnvDTE.Processes = DTE.Debugger.LocalProcesses
    24: Dim Process As EnvDTE.Process
    25: Dim ProcessFound As Boolean = False
    26:
    27: For Each
    Process In Processes
    28: If (Process.Name.Substring(Process.Name.LastIndexOf("\") + 1) = ProcessName) Then
    29:
    Process.Attach()
    30: ProcessFound = True
    31: End If
    32: Next
    33:
    34:
    AttachToProcess = ProcessFound
    35:
    36: End Function
    37:
    38: End Module
    39:
  • 相关阅读:
    本周总结
    本周总结:用户故事和用户场景
    排球比赛规则说明书
    我与计算机
    官网地址备份
    连续自然数序列,求取中位数方案
    Spark 实现自定义对象sequenceFile方式存储,读写示例(scala编写)
    hbase 异常
    python_初步
    redis_入门网址
  • 原文地址:https://www.cnblogs.com/zhangronghua/p/AutoAttachedToWebServerProcess.html
Copyright © 2011-2022 走看看