如题,WPF程序 怎么用FTP下载文件到指定位置 ? 还有如果是winform的话 指定位置设为 Application.StartupPath  + "\\temp\\";
在wpf里面怎么获得这个位置呢

解决方案 »

  1.   

    在WPF中获取自身的启动路径,是采用进程的方式来获取的String appStartupPath = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
      

  2.   

    在WPF中获取自身的启动路径,是采用进程的方式来获取的String appStartupPath = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
      

  3.   

    或者
    AppDomain.CurrentDomain.BaseDirectory;
    Assembly.GetEntryAssembly().Location
    System.Windows.Forms.Application.StartupPath //前面的不能少
    System.IO.Directory.GetCurrentDirectory()好像都可以