x09818
|
分享:
▲
依据您给我的讯息与说明 将其简化请参考看看~ 复制程式
Public Class Form1
Dim writer As System.IO.StreamWriter
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.OpenFileDialog1.Filter = "文字档案(*.txt)|*.txt"
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim line_array() As Object = Split(My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName), vbNewLine)
Dim data_temp As String = ""
Dim k As Integer = 0
data_temp = Join(line_array, ",")
Dim data_array() As Object = Split(data_temp, ",")
Dim temp_array(49) As Integer
For i = 0 To 49 : temp_array(i) = 0 : Next
For i = 0 To UBound(data_array)
If (IsNumeric(data_array(i))) Then
If (data_array(i) >= 1 And data_array(i) <= 49) Then
temp_array(Int(data_array(i))) += 1
k += 1
Else
temp_array(0) += 1
End If
Else
temp_array(0) += 1
End If
Next
TextBox1.Text = "统计结果:" & vbCrLf
For i = 1 To 49
TextBox1.Text &= "开出号码为" & i & "的数量是" & temp_array(i) & vbCrLf
Next
TextBox1.Text &= "总计笔数:" & k & "笔"
End If
End Sub
End Class 资料档 复制程式
期别,开奖日期,号码1,号码2,号码3,号码4,号码5,号码6,特别号码 请依照本格式填入(只有01~49的数字会统计)
990001,99/01/01,01,02,03,04,05,06,07
990002,99/01/03,11,12,13,14,15,16,17
990003,99/01/05,01,02,03,04,05,06,07
990004,99/01/07,01,02,03,04,05,06,07
990005,99/01/10,01,02,03,04,05,06,07
990006,99/01/11,01,02,03,04,05,06,07
990007,99/01/13,01,02,03,04,05,06,07
990008,99/01/22,01,02,03,04,05,06,07 执行档与资料档于附件中~
此文章被评分,最近评分记录财富:50 (by 三仙) | 理由: ^^ 因为您的参与,让程式设计更容易!! | |
|
|
|