自定义类(ASP.NET_VB)

王朝asp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

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

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有  導航