string反向找位置,分割字符串(只取文件夹路径)
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反向找位置,分割字符串(只取文件夹路径)的更多相关文章
- python实现将大文件夹分割成多个子文件夹
楼主用的linux,一旦数据达到几万,文件夹打开就会变卡,同时也方便同时分工协作,便于git管理,写了个将大文件夹分割成多个小文件夹的脚本 如操作文件夹:img,脚本不破坏img的数据,创建img_1 ...
- 找关键字,分割字符串,输出一个vector
vector<string> split(const string& str, const string& delim) { vector<string> re ...
- java.lang.string split 以点分割字符串无法正常拆分字符串
//错误的做法String ip="192.168.11.23"; String[] spstr_IP=ip.split(".");//这种方式无法拆分在ip字 ...
- C 语言简历一个文件夹 并自己输入字符 来取文件夹名字
int main(void) { FILE *fp; char ch,filename[10]; scanf("%s",filename); if((fp=fopen(filena ...
- WinRAR打包时不包含文件夹本身,只打包文件夹里的文件和目录
加上-ep1 参数即可. rar u -m3 -s -r -o+ -ep1 -x*.zip client_zmv9.zip ".\client_zmv9\*"
- idea web项目启动失败的情况---webapp文件夹路径不对,应如图位置
- python----获取文件的路径(各种方式)
#获取到当前文件的上个文件夹目录ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__))) #获取的是相对路径FRON ...
- 找不到/lib/modules/../build文件夹
:解决了make: *** /lib/modules/3.2.0-4-amd64/build: 没有那个文件或目录的问题,更新一下软件列表,然后sudo apt-get install linux-h ...
- 2018-8-10-win10-uwp-获取文件夹出错
title author date CreateTime categories win10 uwp 获取文件夹出错 lindexi 2018-08-10 19:16:50 +0800 2018-2-1 ...
随机推荐
- 【JavaWeb项目】一个众筹网站的开发(八)后台页面详细设置
一.user.jsp改造 删除引入菜单 抽取导航栏 nav-bar.jsp,删除引入导航栏 删除引入main.jsp的到好烂 数据库里添加url 报错,url不对 没有/ url正确 action=& ...
- 【leetcode】967. Numbers With Same Consecutive Differences
题目如下: Return all non-negative integers of length N such that the absolute difference between every t ...
- shell编程基础干货
变量及赋值 设置变量 A=‘china’ 取消变量 unset A 加上 export 关键字 代表全局变量 a=$(ls -l /root/bin) ##运行里面的命令,并把结 ...
- 数字IT基础-数据采集总线
摘要: 日志服务是阿里自产自用的产品,在双十一.双十二和新春红包期间承载阿里云/蚂蚁全站.阿里电商板块.云上几千商家数据链路,每日处理来自百万节点几十PB数据,峰值流量达到每秒百GB, 具备稳定.可靠 ...
- shiro与spring的整合
shiro与spring的整合 上一期,我们分享了如何在项目中使用shiro,了解了shiro的基本用法,但毕竟学习shiro的目的就是在项目中应用shiro,更准确地说是在web项目中应用shiro ...
- JEECG树(TreeGrid)字段的扩展
转载:https://blog.csdn.net/huangzirong822/article/details/38400817 之前使用jeecg集成框架做过一个项目 这里说说框架中树(tree)字 ...
- MarkDown 快速开始 上手
*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* ...
- HDU 6697 Closest Pair of Segments (计算几何 暴力)
2019 杭电多校 10 1007 题目链接:HDU 6697 比赛链接:2019 Multi-University Training Contest 10 Problem Description T ...
- Java反射机制调用私有方法
1.获取目标类: 每个类都有一个class属性,通过实体类的class属性获取: Class clazz = Person.class 通过对象获取. Person p1 = new Person( ...
- 使用uc进行手机页面调试
最近使用uc浏览器的时候发现了,一个有趣的现象,就是uc会处理h5web app为全屏,并屏蔽一些手机上的操作,这样就会使web app更加接近本地应用.所以就研究 了一下uc的手机调试. 1.准备工 ...