比较完整的 WINDOWS 系统路径获取方法

VC++系统各种路径信息的获取 ①、Windows、System32、temp 等目录的获取: TCHAR szPath[MAX_PATH] = {0}; GetSystemDirectory(szPath, MAX_PATH); //C:\WINDOWS\system32 GetWindowsDirectory(szPath, MAX_PATH); //C:\WINDOWS GetTempPath(MAX_PATH, 阅读详情

做WIN下面的开发,不可避免要用到一些系统路径,在开发 FreeEIM 时,用到的一些代码,比较完整的 WINDOWS 系统路径获取方法。

 

#include <Shlobj.h>
#include <stdio.h>
#include <locale.h>

int main()
{
	setlocale(LC_ALL, "chs");

	TCHAR szPath[MAX_PATH];

	int CSIDL[] = {
		CSIDL_ADMINTOOLS,		CSIDL_APPDATA,	CSIDL_CDBURN_AREA,		CSIDL_COMMON_ADMINTOOLS,	CSIDL_COMMON_APPDATA,
		CSIDL_COMMON_DESKTOPDIRECTORY,			CSIDL_COMMON_DOCUMENTS,	CSIDL_COMMON_FAVORITES,		CSIDL_COMMON_MUSIC,
		CSIDL_COMMON_PICTURES,	CSIDL_COMMON_PROGRAMS,	CSIDL_COMMON_STARTMENU, CSIDL_COMMON_STARTUP,
		CSIDL_COMMON_TEMPLATES, CSIDL_COMMON_VIDEO,		CSIDL_COOKIES,			CSIDL_FAVORITES,
		CSIDL_HISTORY,			CSIDL_INTERNET_CACHE,	CSIDL_LOCAL_APPDATA,	CSIDL_MYDOCUMENTS,
		CSIDL_MYMUSIC,			CSIDL_MYPICTURES,		CSIDL_MYVIDEO,			CSIDL_PROFILE,		CSIDL_PROGRAM_FILES,
		CSIDL_PROGRAM_FILES_COMMON,						CSIDL_PROGRAMS,			CSIDL_RECENT,		CSIDL_SENDTO,
		CSIDL_STARTMENU,		CSIDL_STARTUP,			CSIDL_SYSTEM,			CSIDL_TEMPLATES,	CSIDL_WINDOWS,
		0
	};

	for (int i=0;CSIDL[i];i++) {
		if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL[i], NULL, SHGFP_TYPE_CURRENT, szPath))) {
			wprintf(L"%d, %s\n", i, szPath);
		}
	}

	return 0;
}


在XP上,用VS2010编译通过,如果是win7或者更高版本,应该用

HRESULT SHGetKnownFolderPath(
  _In_      REFKNOWNFOLDERID rfid,
  _In_      DWORD dwFlags,
  _In_opt_  HANDLE hToken,
  _Out_     PWSTR *ppszPath
);


以下是编译输出。

0, C:\Documents and Settings\Administrator\「开始」菜单\程序\管理工具
1, C:\Documents and Settings\Administrator\Application Data
2, C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\CD Burning
3, C:\Documents and Settings\All Users\「开始」菜单\程序\管理工具
4, C:\Documents and Settings\All Users\Application Data
5, C:\Documents and Settings\All Users\桌面
6, C:\Documents and Settings\All Users\Documents
7, C:\Documents and Settings\All Users\Favorites
8, C:\Documents and Settings\All Users\Documents\My Music
9, C:\Documents and Settings\All Users\Documents\My Pictures
10, C:\Documents and Settings\All Users\「开始」菜单\程序
11, C:\Documents and Settings\All Users\「开始」菜单
12, C:\Documents and Settings\All Users\「开始」菜单\程序\启动
13, C:\Documents and Settings\All Users\Templates
14, C:\Documents and Settings\All Users\Documents\My Videos
15, D:\My Documents\Cookies
16, D:\My Documents\Favorites
17, C:\Documents and Settings\Administrator\Local Settings\History
18, C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files
19, C:\Documents and Settings\Administrator\Local Settings\Application Data
20, D:\My Documents
21, D:\My Documents\My Music
22, D:\My Documents\My Pictures
23, D:\My Documents\My Videos
24, C:\Documents and Settings\Administrator
25, C:\Program Files
26, C:\Program Files\Common Files
27, C:\Documents and Settings\Administrator\「开始」菜单\程序
28, C:\Documents and Settings\Administrator\Recent
29, C:\Documents and Settings\Administrator\SendTo
30, C:\Documents and Settings\Administrator\「开始」菜单
31, C:\Documents and Settings\Administrator\「开始」菜单\程序\启动
32, C:\WINDOWS\system32
33, C:\Documents and Settings\Administrator\Templates
34, C:\WINDOWS


 

掌握VC++:获取系统路径的源码实现 Windows系统目录是操作系统的重要组成部分,它包含了系统运行所必需的核心文件和设置。这些目录通常存储在系统盘(通常是C盘)的根目录下,如Windows、System32和Program Files等。系统目录中的文件对于系统的启动、运行和稳定性至关重要,例如,Windows目录存储了系统核心文件和用户界面资源,而System32目录则包含了大部分的系统驱动和动态链接库(DLL)文件。系统目录的作用不仅限于存放系统文件,它们还通过预设的权限和访问控制列表(ACL)来确保系统安全。 阅读详情

相关推荐

ESP32+ST7789 LCD屏实战:5分钟搞定中文显示与图片渲染(附完整代码)

本文提供了一份详细的ESP32驱动ST7789 LCD屏幕的实战指南。通过清晰的SPI硬件连接说明、ESP-IDF框架下的初始化代码,以及图片渲染与中文字库构建的核心算法,帮助开发者快速实现中文显示与图片渲染功能,并附有完整的代码示例和性能优化技巧。

weixin_29189377的博客 447

windows 路径常用 CSIDL

CSIDL value remarks 0 CSIDL_DESKTOP 0x0 C:\Users\Administrator\Desktop 1 CSIDL_INTERNET 0x1 2 CSIDL_PROGRAMS 0x2 3 CSIDL_CONTROLS 0x3 ...

zing's blog 1653

001:InVEST学习——产水/水源涵养

InVEST产水模块介绍 前言 (一些碎碎念着急的可以忽略)最开始做inVEST模型是2020年中,应该说对这个软件有很特殊的感情,之前一直想出一个教程,但是因为事情多加上拖延加上懒就耽搁了,事实证明东西不用就确实荒废了,现在面对当初自己做的东西顶多也就能想起一些思路,很多细节都忘了,所以这个教程也相当于是一个备忘录吧。 ...

Victoriaac的博客 2万+

获取Windows系统特殊性目录路径

引用单元   uses ShlObj   获取方法: function GetPath(FID: Integer): string; var   pidl: PItemIDList;   path: array[0..MAX_PATH] of Char; begin   SHGetSpecialFolderLocation(0, FID, pidl);   SH

HCMCT Studio 2496

即梦文生视频逆向接口部署使用

有的小伙伴不知道这个地址如何填写,你可以理解是步骤3上提供的 服务器或者本地电脑IP 地址(不要写 http://127.0.0.1 或者http://localhsot ) 是 (192.168.XXX.XXX 参考)

weixin_44245188的博客 3201

【WRF-Chem第二期】WRF-Chem有关 namelist 详解

【WRF-Chem第二期】WRF-Chem有关 namelist 详解

WW、forever的博客 2157

CSIDL_PROGRAM_FILES

 Unable to start program %CSIDL_PROGRAM_FILES%/... .exe解决方法:将运行程序缺少的dll、lib等文件拷到执行程序的目录下。

kuiyuan的专栏 2325

基于IEEE39节点系统的风力发电机组并网改造与稳定性研究

本文研究了基于IEEE39节点系统的风力发电机组并网改造与稳定性问题。首先将系统工作频率从60Hz转换为50Hz,并对同步发电机、变压器、线路和负荷参数进行相应调整。随后将30、32、34、37号节点的同步发电机替换为不同容量的永磁同步发电机(PMSG)和双馈感应发电机(DFIG),详细建立了两种风电机组的数学模型和控制策略。通过Simulink仿真验证,改造后的系统能够稳定运行并满足并网要求。研究成果为大规模风电并网系统仿真提供了参考,对提高电力系统可再生能源消纳能力具有重要意义。

huanghm88的专栏 115

CSIDL

csidl  编辑 本词条缺少名片图,补充相关内容使词条更完整,还能快速升级,赶紧来编辑吧! CSIDL描述及使用说明: CSIDL 表示的是windows shell中一个特殊文件夹的标识值。这里说的特殊文件夹指的是由windows shell所定义的文件夹, 中文名 csidl 正    文 CSIDL描述及使用说明: 表    示

haiross的专栏 1522

Android 车载开发深度解析:CarPropertyManager 核心机制与实践指南

摘要: Android Automotive OS中,CarPropertyManager作为车载信息娱乐系统的核心组件,连接应用层与车辆硬件(如车速、油量等),其架构基于分层设计(App→CarAPI→VHAL→ECU),采用发布-订阅模式实现高效数据通信。通过HIDL/AIDL跨进程交互及共享内存优化,延迟可降至2ms以下。安全机制包括分级权限控制(VISIBLE/PROTECTED/SYSTEM_RESTRICTED)和HMAC防篡改。开发时需注意监听器生命周期管理、事件合并降负载及低功耗适配。

郑伟强dev的专栏 348

高温环境下(100℃以上)相机的几种保障方案

高温环境下相机保障措施摘要:针对120℃以上高温环境,相机需采取多重防护:1.散热设计采用金属机身、散热鳍片或风扇;2.关键部件选用耐高温材料(铝合金、特种玻璃);3.电子元件需军规级芯片并做三防处理;4.建议外接电源或耐高温电池。工业相机(如FLIR A655sc、Basler ace)及特种机型(Ximea xiQ)具备高温适应性,普通相机可加装隔热套件配合冷却系统。选择时需关注传感器信噪比和全局快门性能,并设置温度监控保护机制。注意高温会加速设备老化,需定期检测维护。(149字)

start_up_go的博客 1597

windows下获取dll完整路径的方法

在封装dll的程序中,经常需要在dll程序中读取配置文件或者是保存中间结果,为了减少这些路径的由上层调用程序传入,我们经常会要求将配置文件跟dll放在一起即可,然后让程序自动获取到配置文件的位置:程序中在读取配置文件时的先获取自身dll所在的路径(*****.dll),然后根据该路径信息和配置文件的名称即可读取相应的配置文件。另外,中间结果保存路径,我们是只是想办法直接把中间结果保存在dll相同的...

wangyjfrecky的博客 4341

Qt Creator配置MSVC编译环境、调试环境

获取和安装:cdb.exe 在 Debugging tools for Windows 中,而现在已经不单独提供下载,只在Windows SDK 或者Windows Driver Kit里面包含 所以需要下载微软的调试工具,最少需要下载 Windows SDK。在windows上开发,一般使用Qt Creator自带mingw编译器,编译和调试都很方便,安装Qt时勾选后,自动配置完毕。但是有时候我们需要使用MSVC的编译器,这个时候我们没法直接使用,需要配置环境才能使用,以下是配置方案。

希望能帮助大家,希望大家多多支持,你们的支持是我前进的动力。 6994

C++之获取当前程序的路径、Windows目录的路径和系统目录的路径

对于Windows,系统目录通常位于C:\Windows\System32(对于32位系统)或C:\Windows\SysWOW64(对于64位系统中的32位应用程序)。例如,如果你的程序名为MyApp.exe,并且它位于C:\Program Files\MyApp\目录下,那么当前程序的路径就是C:\Program Files\MyApp\MyApp.exe。这个头文件用于输入/输出流,尽管在这段代码中它并没有被用到,因为所有路径的打印都是通过`wprintf`完成的,而不是`std::cout`。

T20151470的博客 4548

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

Windows API 获取系统路径

每次写代码获取系统路径都是要百度一番,以为重来记不住,也没想去记住这些API。 但是这样每次开发效率就比较低,所以还是整理下吧,加深下印象,至少后面可以在自己博客里就能轻松的找到了吧。 直接上代码吧。 #include "stdafx.h" #include <Shlobj.h> #include <tchar.h> #include <Windo...

最快的脚步不是跨越,而是继续;最慢的步伐不是缓慢,而是徘徊! 1797

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

Mac/Windows系统中 C++获取路径的方法(混乱的正反斜杠)

Windows系统 windows系统文件分隔符是:“ \ " 路径获取方法:右键 → 属性 → 得到文件路径 获取到的文件路径是这样的:C:\hello\file.txt (相对路径) C++中,\\表示的是一个转义字符,他表示 \ , 所以在Windows系统下用C++来获取文件路径的方法有两种: CString filename=Path("C:\\hello\\file.tx...

慧子 2328

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

JAVA 获取windows系统路径

Java 获取 Windows 系统路径 在开发过程中,我们常常需要获取系统的环境变量或者系统路径信息。今天,我们将一起学习如何通过 Java 来获取 Windows 系统路径。本篇文章将为初学者提供明确的指导,包括具体的实现步骤、每一步的代码以及详细的注释。我们还会使用图示(类图与状态图)来帮助理解。 一、流程概述 下面...

weixin_41545204的博客 661

【WINDOWS核心编程】windows获取路径的方法

【一】GetCurrentDirectory获取当前进程的当前目录(避免使用) DWORD GetCurrentDirectory( DWORD nBufferLength,//sizeofdirectorybuffer LPTSTR lpBuffer//directorybuffer ); 参数说明 nBufferLength 缓冲区的长度 lpBuffer 指定一个预定义字串,用于装载当前目录 返回值 调用成功 返回装载到lpBuffer的字节数。 使用GetLastError函数可获得错...

吾志所往,所向披靡 1154

C# 获取当前路径的7种方法

1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName -获取模块的完整路径。 2. System.Environment.CurrentDirectory -获取和设置当前目录(该进程从中启动的目录)的完全限定目录。 3. System.IO.Directory.GetCurrentDirectory()...

小姐姐 3244

获取Windows服务下当前路径的方法

获取Windows服务下当前路径的方法 获取当前运行程序路径 包含exe Assembly.GetExecutingAssembly().Location; D:\xxxxxx\bin\Debug\xx.exe 获取当前运行程序路径 包含exe System.Diagnostics.Process.GetCurrentProcess().MainModule.FileN...

weixin_30485379的博客 816

如何获取文件的完整路径?

有没有一种简单的方法可以打印file.txt的完整路径? file.txt = /nfs/an/disks/jj/home/dir/file.txt <command> di

asdfgh0077的博客 2109

进程完整路径获取方式底层实现剖析

解析GetProcessImageFileName和QueryFullProcessImageName、SeLocateProcessImageName函数,进程完整路径获取方式底层实现剖析

sunjiaoya的博客 1674

Windows C++开发:掌握GetModuleFileName等API安全获取系统路径

在Windows C++开发中,文件路径操作是基础且关键的技术环节,涉及程序安装、配置加载和资源访问等多个场景。其核心原理是通过系统API与操作系统交互,获取真实、可靠的路径信息。这项技术的工程价值在于确保应用程序在不同系统环境和权限下的稳定运行,避免因路径错误导致的文件覆盖、访问拒绝等严重问题。实际应用中,开发者常需获取程序自身目录、系统目录及用户数据目录等关键路径,用于绿色软件部署、安装程序编写或系统工具开发。针对路径获取,Windows平台提供了GetModuleFileName、GetSystemD

weixin_30800807的博客 283

C# Windows获取系统路径汇总

string dir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)

樱花的博客 6727
上一篇: WIN7下获取当前用户文件路径的方法
下一篇: C++实现的 如何删除一个指定的文件
普通网友
博客等级 码龄22年 1万+粉丝 2784原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值