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