源文件:
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文件实现
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文件实现
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;
仅仅是参数的变化,要实现替换
只需要完成从源文件到目标文件的转换就可以了
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)替换)
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);
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);