这样可以吗,
使用System.Diagnostics名称空间中的Process类.如:
using System.Diagnostics;
...
private void button1_Click(object sender, System.EventArgs e)
{
Process myProcess=new Process ();
myProcess.StartInfo.FileName ="d:\\s1.txt";
          //控制启动窗口的风格,(正常,或最小化,最大化等)
myProcess.StartInfo.WindowStyle=ProcessWindowStyle.Normal;
myProcess.Start();
}

解决方案 »

  1.   

    设置Form中三个EDIT控件。
    ----------------------------------
    则可使用SendKeys方法来模拟输入按键事件
    SendKeys.SendWait("{TAB}");
    可在不同的EDIT控件中切换
      

  2.   

    大概可以通过process获得主窗体的HWND,然后用API调整或直接将窗体嵌入自己的FORM中
      

  3.   

    控制窗体位置和大小,我觉得可以用ini文件来
      

  4.   

    把程序中产生的三个字符串保存到固定地方……比如一个文本
    另一个Form启动时再从这个固定的地方把文本读出来然后放EDIT里面……这样就什么也不用传了……^_^
      

  5.   

    在你的菜单中调用这个程序,并设置其窗口大小,与起始位置:
    给你写了个例子——using System.Runtime.InteropServices;
    using System.Diagnostics;public class Test
    {
       [DllImport("User32.dll", CharSet=CharSet.Auto)]
       public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndAfter, int X, int Y, int Width, int Height, uint flags);   private int pos_x;//窗口位置X坐标
       private int pos_y;//窗口位置Y坐标
       private int width;//窗口宽度
       private int height;//窗口高度
       privtte string path;//要调用得应用程序路径   //在构造函数中传入设置信息
       public Test(int x,int y,int width,int height,string path)
       {
          this.pos_x=x;
          this.pos_y=y;
          this.width=width;
          this.height=height;
          this.path=path;
       }
       
       //启动运用程序并设置其窗口位置及大小
       public void StartProcess()
       {
          Process p=new Process();
          p.StartInfo.FileName=this.path;
          p.Start();
          p.WaitForInputIdle();      SetWindowPos(p.MainWindowHandle,IntPtr.Zero,this.pos_x,this.pos_y,this.width,this.heigth, (uint)(0x0020|0x0040));
       }
    }
      

  6.   

    还有一个问题,我怎样才能设置所调用外部程序中Edit控件的Text属性 为我程序中的string变量?
    麻烦,解决立即给分,分不够再加
      

  7.   

    我也有过类似的需求,其相应代码如下:
    hwnd_win = FindWindow(null, "用户登录 - 中心营业部");
    if (hwnd_win == IntPtr.Zero)
    {
    MessageBox.Show("警告:找不到目标窗口");
    return;
    }
    SetFocus(hwnd_win);
    input1(hwnd_win);public void input1(IntPtr myptr)
    {            
    SetFocus(myptr);
    SendKeys.SendWait("11");
    Thread.Sleep(200);
    Application.DoEvents();
    SendKeys.SendWait("{ENTER}"); SendKeys.SendWait("123456");
    Thread.Sleep(200);
    Application.DoEvents();
    SendKeys.SendWait("{ENTER}");
    SendKeys.Send("666666");
    Thread.Sleep(200);
    Application.DoEvents();
    SendKeys.SendWait("{ENTER}");
    return;
    }
    但在运行中有问题,输入的字符容易多发一遍,若不加延时,发送的位置也容易错位,
    不知怎样真正解决这个问题。大家也帮着看看