大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> NET专区 -> 获得临时文件的两种途径

获得临时文件的两种途径

时间: 2021-07-31 作者:daque

path.gettemppath 本领[c#]请拜见path 类 | path 分子 | system.io 定名空间 诉求平台: windows 98, windows nt 4.0, windows millennium edition, windows 2000, windows xp home edition, windows xp professional, windows .net server family.net 框架安定性:environmentpermission 用来对情况变量的无穷制考察。关系的列举:permissionstate.unrestricted 谈话c#c++jscriptvisual basic十足表露归来暂时体例的偶尔文献夹的路途。[visual basic]public shared function gettemppath() as string[c#]public static string gettemppath();[c++]public: static string* gettemppath();[jscript]public static function gettemppath() : string;归来值包括偶尔目次的路途消息的 string。特殊特殊典型 前提 securityexception 挪用方没有所需的权力。 备注底下的代码示例证明 gettemppath 本领的用法。[visual basic] dim temppath as string = path.gettemppath()console.writeline("temporary pathname is '{0}'", temppath)dim tempdir as new directoryinfo(temppath)console.writeline("{0} contains {1} files", temppath, tempdir.getfiles().length)[c#] string temppath = path.gettemppath();console.writeline("temporary path is '{0}'", temppath);directoryinfo tempdir = new directoryinfo(temppath);console.writeline("{0} contains {1} files", temppath, tempdir.getfiles().length);固然,再有个gettempfilename不妨看看----------------------------------------------------------其余一种犹如只能用api了吧[dllimport("kernel32.dll", charset=charset.auto)][return:marshalas(unmanagedtype.u4)]public static extern int gettempfilename(string strpathname,string strprefixstring,[marshalas(unmanagedtype.u4)] uunique,stringbuilder sbtempfilename);

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.