visual_sadegh
پنج شنبه 14 آذر 1387, 10:20 صبح
Public Class DosToWinClass
Dim A() As Byte = {141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137}
Dim B() As String = {"ا", "ئ", "ء", "ا", "ا", "ب", "ب", "پ", "پ", "ت", "ت", "ث", "ث", "ج", "ج", "چ", "چ", "ح", "ح", "خ", "خ", "د", "ذ", "ر", "ز", "ژ", "س", "س", "ش", "ش", "ص", "ص", "ض", "ض", "ط", "ظ", "ع", "ع", "ع", "ع", "غ", "غ", "غ", "غ", "ف", "ف", "ق", "ق", "ك", "ك", "گ", "گ", "ل", "ل", "ل", "م", "م", "ن", "ن", "و", "ه", "ه", "ه", "ي", "ي", "ي", "ي", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
Dim C() As Byte = {0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Private Function Conver_Type(ByVal AsciiCode As Byte) As String
Dim I As Byte
'Dim P As String
If AsciiCode = 13 Then
Conver_Type = vbCrLf
Exit Function
End If
If AsciiCode = 10 Then Return Nothing
For I = 0 To 76
If A(I) = AsciiCode Then Exit For
Next
If I = 77 Then
Select Case Chr(AsciiCode)
Case ")"
Conver_Type = "("
Case "("
Conver_Type = ")"
Case Else
Conver_Type = Chr(AsciiCode)
End Select
Exit Function
End If
If C(I) = 2 Then
Conver_Type = "لا"
Exit Function
End If
Conver_Type = B(I) & IIf(C(I) = 0, String.Empty, Space(1))
End Function
Public Function Conver_To_Windows(ByVal Txt As String) As String
Dim I As Integer
Dim P As String = Nothing
For I = Len(Txt) To 1 Step -1
P = P & Conver_Type(Asc(Mid(Txt, I, 1)))
Next
Conver_To_Windows = P
End Function
Public Sub New()
End Sub
End Class
ببین این به کارت مییاد
vBulletin® v4.2.5, Copyright ©2000-1403, Jelsoft Enterprises Ltd.