网站首页  词典首页

请输入您要查询的函数:

 

术语 setenvironmentvariable
释义 SetEnvironmentVariable
语法:
C++
BOOL WINAPI SetEnvironmentVariable(
__in LPCTSTR lpName,
__in_opt LPCTSTR lpValue
);
SetEnvironmentVariable功能
设置了当前进程指定的环境变量的内容。
参数
lpName [in]
环境变量的名称。该操作系统创建环境变量,如果它不存在,lpValue不是NULL。
lpValue [中,可选]
环境变量的内容。在一个进程环境块总面积不得超过32,767个字符。有关更多信息,请参阅环境变量。
如果这参数为NULL,该变量删除从当前进程的环境。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
此功能不会对系统环境变量或其它进程的环境变量的影响。
实例
有关示例,请参阅更改环境变量。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesSetEnvironmentVariableW(Unicode)和SetEnvironmentVariableA(ANSI)的
参见
环境变量
GetEnvironmentVariable
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SetEnvironmentVariable Function
Sets the contents of the specified environment variable for the current process.
Syntax
C++
BOOL WINAPI SetEnvironmentVariable(
__in LPCTSTR lpName,
__in_opt LPCTSTR lpValue
);
Parameters
lpName [in]
The name of the environment variable. The operating system creates the environment variable if it does not exist and lpValue is not NULL.
lpValue [in, optional]
The contents of the environment variable. The total size of the environment block for a process may not exceed 32,767 characters. For more information, see Environment Variables .
If this parameter is NULL, the variable is deleted from the current process's environment.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
This function has no effect on the system environment variables or the environment variables of other processes.
Examples
For an example, see Changing Environment Variables .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesSetEnvironmentVariableW (Unicode) and SetEnvironmentVariableA (ANSI)
See Also
Environment Variables
GetEnvironmentVariable
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686206(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:21:04