zoukankan      html  css  js  c++  java
  • 获取 / 设置 进程的工作目录(当前目录)

    1、C++:

      GetCurrentDirectory()             // 获取当前进程的工作目录  

      SetCurrentDirectory()             // 设置当前进程的工作目录  

      VS 当前路径指定为 exe 所在的路径:
       char sBuf[1024];
          char *ptr;
          if (GetModuleFileNameA(NULL, sBuf, sizeof(sBuf)))
          {
              ptr = strrchr(sBuf, '\');
              if (ptr)
                  *ptr = '';
              SetCurrentDirectoryA(sBuf);
          }
      

    2、C#:  

      System.IO.Directory.GetCurrentDirectory()              // 获取当前进程的工作目录

      System.IO.Directory.SetCurrentDirectory()              // 设置当前进程的工作目录

      Application.StartupPath                           // 应用程序启动目录

      AppDomain.CurrentDomain.SetupInformation.ApplicationBase     // 应用程序启动目录

  • 相关阅读:
    小程序实现无限瀑布流
    Vue H5 项目模板
    Taro使用mobx做国际化小程序
    一次国际化记录以及平铺JSON数据
    Promise(interesting)
    返回状态码
    CSS属性兼容写法
    在DOM加载之前insertScript
    关于吸烟
    前端优化措施
  • 原文地址:https://www.cnblogs.com/dhqy/p/9084303.html
Copyright © 2011-2022 走看看