<script language="VB" runat="server">
 Dim Shared a As Integer
 Dim Shared b As Integer
 Dim Shared c As Integer
 Dim Shared d As Integer
 Sub ImageButton_Click(sender as object,e as ImageClickEventArgs)
 Label6.text=""
 Randomize
 a = int(9*rnd()+1)
 b = int(9*rnd()+1)
 c = int(9*rnd()+1)
 d= int(9*rnd()+1)
……
          End Sub
</script>

解决方案 »

  1.   

    Dim Shared a As Integer -》
    static int a;
      

  2.   

    static int a;
    static int b;
    static int c;
    static int d;
    private void ImageButton_Click(object sender, System.EventArgs e)
    {
    Label6.text="";
        Random rand = new Random();
                              
    }
      

  3.   

    static int a;
    static int b;
    static int c;
    static int d;
    private void ImageButton_Click(object sender, System.EventArgs e)
    {
    Label6.text="";
        Random rand = new Random();
                             a=rand.Next(1,9);
                             b=rand.Next(1,9);
                             c=rand.Next(1,9);
                             d=rand.Next(1,9); 
    }