Different code between C# and VBasic

  • Thread starter Thread starter mipakteh
  • Start date Start date
M

mipakteh

Guest
Hi All,

somebody can show how to write back this code to C# languages;When Button_1 click

then TextBox2 show bellow.

1573009.png

Option Strict On
Option Infer Off
Option Explicit On

Imports System.IO
Imports System.Data
Imports System.Text
Public Class Form1

Dim Data As New List(Of String)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TxtFile=
' 2311,3461,1965,2553,8363,1540,1969,8385,1281,5885,4951,8862,5830,7845,6239,0927,5144,7703,6525,6011,6153,8522,8221
' 3096,9575,5857,7523,2939,8257,1090,7786,3978,2445,5678,6082,5068,3348,3116,0567,5330,3163,8051,1694,6228,0958,0520

Data.AddRange(IO.File.ReadAllLines("C:\Users\60129\Documents\2Lines_.txt"))

For I As Integer = 0 To Data.Count - 1
TextBox1.AppendText(Data(I) & vbCrLf)
Next

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

For I As Integer = 0 To Data.Count - 1

Dim A As New List(Of Integer)
Dim B As New List(Of Integer)

For J As Integer = 0 To 9
Dim StringToFind As Integer = J
Dim StringToCheck As Integer = Data(I).Count(Function(c As Char) c = StringToFind.ToString)
A.Add(StringToFind)
B.Add(StringToCheck)

TextBox2.AppendText(StringToFind & " =" & StringToCheck & vbCrLf)

Next
TextBox2.AppendText(vbCrLf)

Next

End Sub
End Class



Thank

Continue reading...
 

Similar threads

M
Replies
0
Views
130
mipakteh
M
M
Replies
0
Views
130
mipakteh
M
M
Replies
0
Views
73
mipakteh
M
Back
Top