源文件:
Point point = new Point(8, 0x16);
this.ProgressBar1.Location = point;
this.ProgressBar1.Name = "ProgressBar1";
Size size = new Size(220, 12);
this.ProgressBar1.Size = size;point = new Point(0xec, 0);
this.PictureBox1.Location = point;
size = new Size(0x1f, 0x1f);
this.PictureBox1.Size = size;point = new Point(12, 6);
this.Label1.Location = point;
size = new Size(0x44, 0x10);
this.Label1.Size = size;
目标文件:
Point point = new Point(8, 0x16);
this.ProgressBar1.Location = point;
this.ProgressBar1.Name = "ProgressBar1";
Size size = new Size(220, 12);
this.ProgressBar1.Size = size;
this.PictureBox1.Location =new Point(0xec, 0);this.PictureBox1.Size = new Size(0x1f, 0x1f);
this.Label1.Location = new Point(12, 6);this.Label1.Size = new Size(0x44, 0x10);
怎么用C#代码,做一个bat文件实现

解决方案 »

  1.   

    在原文件中出现:
    point = new Point(0xec, 0);
    this.PictureBox1.Location = point;
    size = new Size(0x1f, 0x1f);
    this.PictureBox1.Size = size;point = new Point(12, 6);
    this.Label1.Location = point;
    size = new Size(0x44, 0x10);
    this.Label1.Size = size;
    仅仅是参数的变化,要实现替换
    只需要完成从源文件到目标文件的转换就可以了
      

  2.   

    Point point = new Point(8, 0x16);
    this.ProgressBar1.Location = point;
    this.ProgressBar1.Name = "ProgressBar1";
    Size size = new Size(220, 12);
    this.ProgressBar1.Size = size;point = new Point(0xec, 0); (这一行要去掉)
    this.PictureBox1.Location = point;(把pint用上面的new Point(0xec, 0)替换)
    size = new Size(0x1f, 0x1f);(这一行要去掉)this.PictureBox1.Size = size;(把size用上面的new Size(0x1f, 0x1f)替换)
    point = new Point(12, 6); (这一行要去掉)
    this.Label1.Location = point; (把pint用上面的new Point(12, 6);替换
    size = new Size(0x44, 0x10); (这一行要去掉)this.Label1.Size = size; (把size用上面的new Size(0x44, 0x10)替换)
      

  3.   

    我的需求就是用C#代码实现:将源文件(cs文件)中的两个实例中,有定义参数,把参数用赋值替换掉,将给参数赋值的那一行删除掉,源文件是:
    Point point = new Point(8, 0x16);
    this.ProgressBar1.Location = point;
    this.ProgressBar1.Name = "ProgressBar1";
    Size size = new Size(220, 12);
    this.ProgressBar1.Size = size;point = new Point(0xec, 0);
    this.PictureBox1.Location = point;
    size = size
    this.PictureBox1.Size = size;point = new Point(12, 6);
    this.Label1.Location = point;
    size = new Size(0x44, 0x10);
    this.Label1.Size = size;
    要实现的结果是:用代码生成:
    Point point = new Point(8, 0x16);
    this.ProgressBar1.Location = point;
    this.ProgressBar1.Name = "ProgressBar1";
    Size size = new Size(220, 12);
    this.ProgressBar1.Size = size;
    this.PictureBox1.Location =new Point(0xec, 0);this.PictureBox1.Size = new Size(0x1f, 0x1f);
    this.Label1.Location = new Point(12, 6);this.Label1.Size = new Size(0x44, 0x10);
      

  4.   

    Point point = new Point(8, 0x16);
    this.ProgressBar1.Location = point;
    this.ProgressBar1.Name = "ProgressBar1";
    这个为什么就不变呢?
    this.ProgressBar1.Location = new Point(8, 0x16);
    this.ProgressBar1.Name = "ProgressBar1";
    this.ProgressBar1.Size = new Size(220, 12);
      

  5.   

    用个文件比较软件就可以了,象Beyond Compare 这样的软件完全能达到你的要求