打印本文 打印本文 关闭窗口 关闭窗口
自定义类(ASP.NET_VB)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数666  更新时间:2009/4/23 10:40:37  文章录入:mintao  责任编辑:mintao

Imports System.Diagnostics

Public Class FSVCommon

    ''''********************************************************************************************
    ''''功能  :关闭指定进程
    ''''参数  :ProcessName:进程名
    ''''返回值:无
    ''''上传时间:2005/04/18
    ''''********************************************************************************************
    Public Shared Function KillProcess(ByVal ProcessName As String)
        Dim pProcess() As Process     ''''进程序列
        Dim myProcess As Process      ''''进程名

        pProcess = Process.GetProcessesByName(ProcessName)
        ''''查找所指定的进程
        For Each myProcess In pProcess
            myProcess.Kill()
        Next
    End Function

    ''''********************************************************************************************
    ''''功能  :计算指定字符串的长度(Web)
    ''''参数  :txtString:指定字符串
    ''''返回值:长度
    ''''上传时间:2005/04/18
    ''''********************************************************************************************
    Private Function GetLength(ByVal txtString As String) As Integer
        Dim textLength As Integer                         ''''字符串的长度
        textLength = txtString.Length

        Dim i As Integer                                  ''''循环变量

        For i = 0 To txtString.Length - 1
            ''''是否为全角字符的判断
            If Not (0 <= Asc(txtString.Substring(i, 1)) _
                And Asc(txtString.Substring(i, 1)) <= 255) And _
                Not (65377 <= Asc(txtString.Substring(i, 1)) _
                And Asc(txtString.Substring(i, 1)) <= 65439) Then
                textLength = textLength + 1
            End If
        Next

        Return textLength
    End Function

End Class

打印本文 打印本文 关闭窗口 关闭窗口