Private Sub Command1_Click()
Dim gma00
Dim i, i1, h As Integer
Dim sA As String * 65400 '注释:声明定长String变量
 Open "d:\123\落球码4.txt" For Binary As #1 '注释:用二进制打开文件
   Get #1, , sA '注释:用Get语句从文件中获取字节
   Text1 = sA '注释:显示打开的文件
 Close #1 '注释:关闭文件
   gma00 = Split(sA, ",")
     n = UBound(gma00)
     na = n / 11 - 9
       For h = 0 To na
         For i = h + 1 To 9 + h
           For i1 = i * 11 To i * 11
               yxa00 = Int(gma00(i1 - 11))
               yxa01 = Int(gma00(i1 - 10))
               yxa02 = Int(gma00(i1 - 9))
               yxa03 = Int(gma00(i1 - 8))
               yxa04 = Int(gma00(i1 - 7))
               yxa05 = Int(gma00(i1 - 6))
               yxa06 = Int(gma00(i1 - 5))
               yxa07 = Int(gma00(i1 - 4))
               yxa08 = Int(gma00(i1 - 3))
               yxa09 = Int(gma00(i1 - 2))
               yxa10 = Int(gma00(i1 - 1))
    Debug.Print Format(yxa00, "00"); ","; Format(yxa01, "00"); ","; Format(yxa02, "00"); "," _
              ; Format(yxa03, "00"); ","; Format(yxa04, "00"); ","; Format(yxa05, "00"); "," _
              ; Format(yxa06, "00"); ","; Format(yxa07, "00"); ","; Format(yxa08, "00"); "," _
              ; Format(yxa09, "00"); ","; Format(yxa10, "00")
           Next
         Next
      Next
End Sub

解决方案 »

  1.   

    up, 
    楼主看一下File, Stream(streamreader,streamwriter),string方面的资料应该就可自己解决了.
      

  2.   

    private void command_click()
    {
       int []aa;
       int i,i1,h;
        
    }
      

  3.   

    能不能详细点
    如.txt 
    11,22,22,33,44,45,
    12,23,22,22,55,43,
    13,11,23,22,22,55,
    14,12,33,55,44,33,
    15,22,55,88,55,55,
    16,22,55,22,45,44,
      

  4.   

    下载一个工具vb.net 转化为 C#
      

  5.   

    http://www.abdown.com/write_program_tools/write_program_tools_24468.html注册机 http://www.abdown.com/write_program_tools/write_program_tools_24469.html
      

  6.   

    sorry, the tool doesnot work.
    it failed to translate the code as i have tried
      

  7.   

    回复人: charles_y(难得糊涂) ( ) 信誉:100  2005-12-24 19:58:00  得分: 0  
     
     
       sorry, the tool doesnot work.
    it failed to translate the code as i have tried
      
     
    那是当然的了,它是VB代码,不能跟VB.NET代码相提并论!
      

  8.   

    String temp;
    //定义String
    System.IO.StreamReader myReader = new System.IO.StreamReader(System.IO.File.OpenRead("C:\\1.txt"));
    //定义Reader
    temp=myReader.ReadToEnd();
    //读到头
    myReader.Close();
    //关闭资源
    this.richTextBox.Text=temp;
    //显示在页面上
    String[] strArray = temp.Replace(Environment.NewLine,"").Split(',');
    int n=strArray.Length;
    int na=n/11-9;
    for(int h=0;h<na;h++)
    //你给的数据不够,na成了负数
    {
    for(int i=h+1;i<9-h;i++)
    {
    for(int i1=i*11;i1<i*11;i1++)
    //你的VB代码是不是写错逻辑了?这样子怎么做循环?
    {
    int int00=int.prase(strArray[i1-11]);
    int int01=int.prase(strArray[i1-10]);
    int int02=int.prase(strArray[i1-9]);
    int int03=int.prase(strArray[i1-8]);
    int int04=int.prase(strArray[i1-7]);
    int int05=int.prase(strArray[i1-6]);
    int int06=int.prase(strArray[i1-5]);
    int int07=int.prase(strArray[i1-4]);
    int int08=int.prase(strArray[i1-3]);
    int int09=int.prase(strArray[i1-2]);
    int int10=int.prase(strArray[i1-1]);
    Console.WriteLine(int00.ToString("00") &
                      "," & int01.ToString("00") &
                      "," & int02.ToString("00") &
                      "," & int03.ToString("00") & 
                      "," & int04.ToString("00") & 
                      "," & int05.ToString("00") & 
                      "," & int06.ToString("00") & 
                      "," & int07.ToString("00") & 
                      "," & int08.ToString("00") & 
                      "," & int09.ToString("00") & 
                      "," & int10.ToString("00"));
    }
    }
    }
      

  9.   

    看见100分,终于忍不住给搂住写了代码!不过搂住一定要对照MSDN学习一下!要不岂不是我"毒害"搂住,让搂住丧失了学习的机会!
      

  10.   

    好像不行?
    int na=n/11-9; 是每行11个数,上面的我写错了,
    如.txt 
    11,22,22,33,44,45,1,2,3,9,5,
    12,23,22,22,55,43,2,3,5,8,9,
    13,11,23,22,22,55,5,2,5,6,8,
    14,12,33,55,44,33,5,9,8,7,8,
    15,22,55,88,55,55,5,6,8,6,8,
    16,22,55,22,45,44,1,2,3,5,4,