当前位置:首页 > 网络编程 > 软件语言 > .NET > 自定义类(ASP.NET_VB)

自定义类(ASP.NET_VB)

点击次数:57 次 发布日期:2008-11-06 08:10:49 作者:源代码网
源代码网推荐
广告载入中
  Imports System.DiagnosticsPublic 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 FunctionEnd Class

源代码网推荐

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华