函数用于辅助数据处理
中文转换函数
英文转换函数
身份证函数
Dim Identify As String = "610231197005212768"
If ValidPIN(Identify) = False Then
Output.Show("无效身份证")
Else
Dim Sex As String = ReadSex(Identify)
Dim Birth As Date = ReadBirthDay(Identify)
Output.Show("性别:" & Sex & ",出生日期:" & Birth)
End If
格式化Format
'格式化Format函数
Output.Show(Format(1, "000")) '001
Output.Show(Format(1.2, "0.00")) '1.20
Output.Show(Format(#2/13/2001#, "yyyy年mm月dd日")) '2001年2月13日
加解密
'字符串加解密
Dim s As String = "罗涛"
Dim s1 As String = EncryptText(s, "a", "6")
Dim s2 As String = DecryptText(s1, "a", "6")
Output.Show("加密后:" & s1)
Output.Show("解密后:" & s2)
'文件加解密:EncryptFile(InFile, OutFile, PassWord)
EncryptFile("c:\temp\Logo.jpg", "c:\temp\Logo2.jpg", "fox123")
DecryptFile("c:\temp\Logo2.jpg", "c:\temp\Logo3.jpg", "fox123")
数学函数
'数学函数
Math.Abs( - 1.23) '1.23 绝对值
Math.Round(3.44, 1) '3.4 舍入到接近的整数或指定的小数位数
Math.Round(3.45, 1) '3.4
Math.Round(3.46, 1) '3.5
Math.Ceiling(123.1) '124 向上取整
Math.Floor(123.1) '123 向下取整
Math.Max(100, 1) '100 最大数
Math.Min(100, 1) '1 最小数
财务函数