Find format correct of variable

Status
Not open for further replies.

Hatwhite

New member
Joined
Jul 31, 2023
Messages
1
Programming Experience
1-3
C#:
Public Function LeftDCE(Text As Object, stt As Object) As Object Return Strings.Left(Conversions.ToString(Text), Conversions.ToInteger(stt)) End Function Public Function GiaiThuatToKen(NoiDungToKen As Object, NoiDungCanLay As Object) As Object Dim result As Object = "" Dim num As Integer = Strings.InStr(Conversions.ToString(NoiDungToKen), "|", CompareMethod.Binary) Dim num2 As Integer = Strings.InStr(num + 1, Conversions.ToString(NoiDungToKen), "|", CompareMethod.Binary) num = Strings.InStr(num2 + 1, Conversions.ToString(NoiDungToKen), "|", CompareMethod.Binary) Dim text As String = Strings.Mid(Conversions.ToString(NoiDungToKen), num2 + 1, num - num2 - 1) num2 = Strings.InStr(num + 1, Conversions.ToString(NoiDungToKen), "|", CompareMethod.Binary) Dim text2 As String = Strings.Mid(Conversions.ToString(NoiDungToKen), num + 1, num2 - num - 1) num = Strings.InStr(text2, "-", CompareMethod.Binary) Dim text3 As String = Conversions.ToString(LeftDCE(text2, num - 1)) Dim flag As Boolean = Strings.Len(text3) = 1 If flag Then text3 = "0" + text3 End If num2 = Strings.InStr(num + 1, text2, "-", CompareMethod.Binary) Dim text4 As String = Strings.Mid(text2, num + 1, num2 - num - 1) Dim flag2 As Boolean = Strings.Len(text4) = 1 If flag2 Then text4 = "0" + text4 End If Dim text5 As String = Conversions.ToString(RightDCE(text2, Strings.Len(text2) - num2)) num = Strings.InStr(text, "-", CompareMethod.Binary) Dim text6 As String = Conversions.ToString(LeftDCE(text, num - 1)) Dim flag3 As Boolean = Strings.Len(text6) = 1 If flag3 Then text6 = "0" + text6 End If num2 = Strings.InStr(num + 1, text, "-", CompareMethod.Binary) Dim text7 As String = Strings.Mid(text, num + 1, num2 - num - 1) Dim flag4 As Boolean = Strings.Len(text7) = 1 If flag4 Then text7 = "0" + text7 End If Dim text8 As String = Conversions.ToString(RightDCE(text, Strings.Len(text) - num2)) Dim instance As Object = Nothing Dim typeFromHandle As Type = GetType(Strings) Dim memberName As String = "UCase" Dim array As Object() = New Object() {NoiDungCanLay} Dim array2 As Object() = array Dim argumentNames As String() = Nothing Dim typeArguments As Type() = Nothing Dim array3 As Boolean() = New Boolean() {True} Dim array4 As Boolean() = array3 Dim left As Object = NewLateBinding.LateGet(instance, typeFromHandle, memberName, array, argumentNames, typeArguments, array3) If array4(0) Then NoiDungCanLay = RuntimeHelpers.GetObjectValue(array2(0)) End If Dim flag5 As Boolean = Operators.ConditionalCompareObjectEqual(left, Strings.UCase("Ngày HSD"), False) If flag5 Then result = text3 End If Dim instance2 As Object = Nothing Dim typeFromHandle2 As Type = GetType(Strings) Dim memberName2 As String = "UCase" Dim array5 As Object() = New Object() {NoiDungCanLay} array2 = array5 Dim argumentNames2 As String() = Nothing Dim typeArguments2 As Type() = Nothing Dim array6 As Boolean() = New Boolean() {True} array4 = array6 Dim left2 As Object = NewLateBinding.LateGet(instance2, typeFromHandle2, memberName2, array5, argumentNames2, typeArguments2, array6) If array4(0) Then NoiDungCanLay = RuntimeHelpers.GetObjectValue(array2(0)) End If Dim flag6 As Boolean = Operators.ConditionalCompareObjectEqual(left2, Strings.UCase("Tháng HSD"), False) If flag6 Then result = text4 End If Dim instance3 As Object = Nothing Dim typeFromHandle3 As Type = GetType(Strings) Dim memberName3 As String = "UCase" Dim array7 As Object() = New Object() {NoiDungCanLay} array2 = array7 Dim argumentNames3 As String() = Nothing Dim typeArguments3 As Type() = Nothing Dim array8 As Boolean() = New Boolean() {True} array4 = array8 Dim left3 As Object = NewLateBinding.LateGet(instance3, typeFromHandle3, memberName3, array7, argumentNames3, typeArguments3, array8) If array4(0) Then NoiDungCanLay = RuntimeHelpers.GetObjectValue(array2(0)) End If Dim flag7 As Boolean = Operators.ConditionalCompareObjectEqual(left3, Strings.UCase("Năm HSD"), False) If flag7 Then result = text5 End If Dim instance4 As Object = Nothing Dim typeFromHandle4 As Type = GetType(Strings) Dim memberName4 As String = "UCase" Dim array9 As Object() = New Object() {NoiDungCanLay} array2 = array9 Dim argumentNames4 As String() = Nothing Dim typeArguments4 As Type() = Nothing Dim array10 As Boolean() = New Boolean() {True} array4 = array10 Dim left4 As Object = NewLateBinding.LateGet(instance4, typeFromHandle4, memberName4, array9, argumentNames4, typeArguments4, array10) If array4(0) Then NoiDungCanLay = RuntimeHelpers.GetObjectValue(array2(0)) End If Dim flag8 As Boolean = Operators.ConditionalCompareObjectEqual(left4, Strings.UCase("Ngày SDC"), False) If flag8 Then result = text6 End If Dim instance5 As Object = Nothing Dim typeFromHandle5 As Type = GetType(Strings) Dim memberName5 As String = "UCase" Dim array11 As Object() = New Object() {NoiDungCanLay} array2 = array11 Dim argumentNames5 As String() = Nothing Dim typeArguments5 As Type() = Nothing Dim array12 As Boolean() = New Boolean() {True} array4 = array12 Dim left5 As Object = NewLateBinding.LateGet(instance5, typeFromHandle5, memberName5, array11, argumentNames5, typeArguments5, array12) If array4(0) Then NoiDungCanLay = RuntimeHelpers.GetObjectValue(array2(0)) End If Dim flag9 As Boolean = Operators.ConditionalCompareObjectEqual(left5, Strings.UCase("Tháng SDC"), False) If flag9 Then result = text7 End If Dim instance6 As Object = Nothing Dim typeFromHandle6 As Type = GetType(Strings) Dim memberName6 As String = "UCase" Dim array13 As Object() = New Object() {NoiDungCanLay} array2 = array13 Dim argumentNames6 As String() = Nothing Dim typeArguments6 As Type() = Nothing Dim array14 As Boolean() = New Boolean() {True} array4 = array14 Dim left6 As Object = NewLateBinding.LateGet(instance6, typeFromHandle6, memberName6, array13, argumentNames6, typeArguments6, array14) If array4(0) Then NoiDungCanLay = RuntimeHelpers.GetObjectValue(array2(0)) End If Dim flag10 As Boolean = Operators.ConditionalCompareObjectEqual(left6, Strings.UCase("Năm SDC"), False) If flag10 Then result = text8 End If Dim instance7 As Object = Nothing Dim typeFromHandle7 As Type = GetType(Strings) Dim memberName7 As String = "UCase" Dim array15 As Object() = New Object() {NoiDungCanLay} array2 = array15 Dim argumentNames7 As String() = Nothing Dim typeArguments7 As Type() = Nothing Dim array16 As Boolean() = New Boolean() {True} array4 = array16 Dim left7 As Object = NewLateBinding.LateGet(instance7, typeFromHandle7, memberName7, array15, argumentNames7, typeArguments7, array16) If array4(0) Then NoiDungCanLay = RuntimeHelpers.GetObjectValue(array2(0)) End If Dim flag11 As Boolean = Operators.ConditionalCompareObjectEqual(left7, Strings.UCase("Ngày tháng năm HSD"), False) If flag11 Then result = text2 End If Dim instance8 As Object = Nothing Dim typeFromHandle8 As Type = GetType(Strings) Dim memberName8 As String = "UCase" Dim array17 As Object() = New Object() {NoiDungCanLay} array2 = array17 Dim argumentNames8 As String() = Nothing Dim typeArguments8 As Type() = Nothing Dim array18 As Boolean() = New Boolean() {True} array4 = array18 Dim left8 As Object = NewLateBinding.LateGet(instance8, typeFromHandle8, memberName8, array17, argumentNames8, typeArguments8, array18) If array4(0) Then NoiDungCanLay = RuntimeHelpers.GetObjectValue(array2(0)) End If Dim flag12 As Boolean = Operators.ConditionalCompareObjectEqual(left8, Strings.UCase("Ngày tháng năm SDC"), False) If flag12 Then result = text End If Return result End Function



How to find format correct of noidungtoken ?
 
This is a C# forum. That code looks to be VB.NET. Perhaps you meant to post your question this site's sister site: vbdotnetforums.com?
 
Status
Not open for further replies.

Latest posts

Back
Top Bottom