1 #include <uf.h>
2 #include <uf_part.h>
3 #include <atlstr.h>
4 #include <iostream>
5 #include <sstream>
6
7 using std::string;
8
9
10 UF_initialize();
11
12 //获取当前part的tag
13 tag_t WorkPart = UF_PART_ask_display_part();
14
15 //获取当前part所在路径
16 char part_fspec[MAX_FSPEC_BUFSIZE+1];
17 UF_PART_ask_part_name(WorkPart, part_fspec);
18
19 //反向找位置,分割字符串(只取文件夹路径)
20 string strPath = part_fspec;
21 string strDir;
22 int nPos = strPath.find_last_of('\\');
23 if (string::npos != nPos)
24 {
25 strDir = strPath.substr(0, nPos);
26 }
27
28 //方法1
29 //转换
30 //char msg[256];
31 //sprintf_s(msg, "start %s", strDir.c_str());
32
33 //打开并显示文件夹(windows cmd)
34 //system(msg);
35
36 //方法2
37 //ShellExecute打开一个文件
38 //ShellExecute(NULL, "open", "C:\\11.txt", NULL, NULL, SW_SHOWNORMAL);
39
40 ////ShellExecute打开并显示文件夹
41 ShellExecute(NULL, "open", strDir.c_str(), NULL, NULL, SW_SHOWNORMAL);
42
43 UF_terminate();

string反向找位置,分割字符串(只取文件夹路径)的更多相关文章

  1. python实现将大文件夹分割成多个子文件夹

    楼主用的linux,一旦数据达到几万,文件夹打开就会变卡,同时也方便同时分工协作,便于git管理,写了个将大文件夹分割成多个小文件夹的脚本 如操作文件夹:img,脚本不破坏img的数据,创建img_1 ...

  2. 找关键字,分割字符串,输出一个vector

    vector<string> split(const string& str, const string& delim) { vector<string> re ...

  3. java.lang.string split 以点分割字符串无法正常拆分字符串

    //错误的做法String ip="192.168.11.23"; String[] spstr_IP=ip.split(".");//这种方式无法拆分在ip字 ...

  4. C 语言简历一个文件夹 并自己输入字符 来取文件夹名字

    int main(void) { FILE *fp; char ch,filename[10]; scanf("%s",filename); if((fp=fopen(filena ...

  5. WinRAR打包时不包含文件夹本身,只打包文件夹里的文件和目录

    加上-ep1 参数即可. rar u -m3 -s -r -o+ -ep1 -x*.zip client_zmv9.zip ".\client_zmv9\*"

  6. idea web项目启动失败的情况---webapp文件夹路径不对,应如图位置

  7. python----获取文件的路径(各种方式)

    #获取到当前文件的上个文件夹目录ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__))) #获取的是相对路径FRON ...

  8. 找不到/lib/modules/../build文件夹

    :解决了make: *** /lib/modules/3.2.0-4-amd64/build: 没有那个文件或目录的问题,更新一下软件列表,然后sudo apt-get install linux-h ...

  9. 2018-8-10-win10-uwp-获取文件夹出错

    title author date CreateTime categories win10 uwp 获取文件夹出错 lindexi 2018-08-10 19:16:50 +0800 2018-2-1 ...

随机推荐

  1. Dubbo---zookeeper 注册中心---xml配置

    1.项目结构(maven项目) 2.pom <?xml version="1.0" encoding="UTF-8"?> <project x ...

  2. 【JZOJ6433】【luoguP5664】【CSP-S2019】Emiya 家今天的饭

    description analysis 首先可以知道不符合要求的食材仅有一个,于是可以容斥拿总方案数减去选不合法食材的不合法方案数 枚举选取哪一个不合法食材,设\(f[i][j]\)表示到第\(i\ ...

  3. Python 修改在使用ddt时测试报告默认显示用例名称与预期不符

    正常在不使用ddt时,在方法下添加注释,即可作为用例描述("""用例描述""") @BeautifulReport.add_test_img ...

  4. Jlink V8固件恢复

    使用附件中的PDF文档步骤即可,但是千万千万记得两点,更新系统很关键,很关键 1.WINXP系统 2.32Bit系统 切记切记,其他的win7,winxp 64就不用试着更新了,全部是坑 大概步骤 J ...

  5. 分块——cf1207F

    这么傻逼的题当时想了那么久 用a数组维护原序列,b[i][j]表示 pos%i=j 的 a[pos]之和 对于每个修改1 x y,先直接修改a[x],然后枚举i=1..700,修改b[i][x%i] ...

  6. css定位的理解

    在CSS中关于定位的内容是:position:relative | absolute | static | fixed ● static 没有特别的设定,遵循基本的定位规定,不能通过z-index进行 ...

  7. php开发面试题---1、php常用面试题一(PHP有哪些特性)

    php开发面试题---1.php常用面试题一(PHP有哪些特性) 一.总结 一句话总结: ①.混合语法:php独特混合了C,Java,Prel以及PHP自创的语法. ②.为动态网页而生:可以比CGI或 ...

  8. 屏幕左侧鼠标常驻,隐藏部分显示,文章鼠标常驻,隐藏部分隐藏(我的hexo next博客)

    文章目录 如图 功能 代码 博客地址:https://mmmmmm.me 源码:https://github.com/dataiyangu?tab=repositories 如图 功能 最左侧添加透明 ...

  9. 为了避免hexo博客换了电脑应该提前做的准备。

    个人博客:https://mmmmmm.me 源码:https://github.com/dataiyangu/dataiyangu.github.io 本文转自:https://www.jiansh ...

  10. gitlab开机启动|启动 停止 重启

    修改配置后的初始化 gitlab-ctl reconfigure 启动 sudo gitlab-ctl start 停止sudo gitlab-ctl stop 重启sudo gitlab-ctl r ...