象下面方法中包含输出参数acount,如何在其他类中使用这个方法showF,如何接收输出参数acount?public void showF(string fp,string flter,int c, PictureBox pb, Label lbl, out int acount)假设上述方法showF在Form1中,而要使用acount的地方实在Form2中。

解决方案 »

  1.   

    Form1 f1 = new Form1()在Form2中调用: 
    int acount ;
    f1.showF(fp,flter,c, pb, lbl, out acount);
      

  2.   

    form1中
    int acount=0;
    public void showF(string fp,string flter,int c, PictureBox pb, Label lbl, out int acount)
    Response.Redirect("Form2.aspx?acount="+acount);//传递参数
    form2中
    int count=(int)Request["acount"];//接受参数
      

  3.   

    在Form1中:
    Form1 f2 = new Form1();
    f2.f1 = this;
    f2.Show();在Form2中:
    Form1 f1 = null; 
    int acount ;
    f1.showF(fp,flter,c, pb, lbl, out acount);
    //MessageBox.Show(acount.ToString());
      

  4.   

    1.方法可为静态2。实例化FORM1