memleak.aspx

来自「Code for VB.NET教程源码 很好的源码」· ASPX 代码 · 共 39 行

ASPX
39
字号
<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.Text" %>

<script language="VB" runat=server>

   Sub Page_Load(Sender as Object, E as EventArgs) 

      if (Application("MemLeak") = Nothing) Then
        Application("MemLeak") = New StringBuilder
      End If

      Dim i as Integer
      Dim buffer as StringBuilder = Application("MemLeak")

      For i=1 to 100000
         buffer.Append("Adding more and more and more...")
      Next i

      Dim ProcessInfo as Process = Process.GetCurrentProcess()
      
      ProcessId.Text = ProcessInfo.Id.ToString()
      VirtualMemSize.Text = ProcessInfo.VirtualMemorySize.ToString()
   
   End Sub

</script>

<html>
   <body>

      <h1> Memory Leak Example.... </h1>

      <hr>

      <h2>Process ID of ASP+: <asp:label id="ProcessId" forecolor=red runat=server/> </h2>
      <h2>Virtual Memory Size of ASP+: <asp:label id="VirtualMemSize" forecolor=red runat=server/> </h2>

   </body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?