C# Path.GetRandomFileName 方法


返回随机文件夹名或文件名。

public static string GetRandomFileName ();

返回

string

随机文件夹名或文件名。

示例

下面的示例显示了方法的输出 GetRandomFileName 。

using System;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string result = Path.GetRandomFileName();
            Console.WriteLine("Random file name is " + result);
        }
    }
}

/*

 This code produces output similar to the following:

 Random file name is w143kxnu.idj
 Press any key to continue . . .

 */
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
YES开发框架
上一篇:C# 时间戳、随机数相关操作
下一篇:AG-Grid 显示列分割线,竖线
评论列表

发表评论

评论内容
昵称:
关联文章

C# Path.GetRandomFileName 方法
Access to the path 'C:\Windows\TEMP\xxx.tmp' is denied.
C# Winform 自定义异常处理方法
LabVIEW生成.NET的DLL——C#下调用NI数据采集设备功能的一种方法 [原创www.cnblogs.com/helesheng]
C# winform无边框窗体移动的四种方法
C#图片处理
dotnet C# 根据椭圆长度和宽度和旋转角计算出椭圆中心点的方法
C#加密:MD5加密
C# txt文本文件的读取与写入,
CSharp编程小技巧-使用枚举 Enum.HasFlag 方法
GZDBHelper数据库操作方法规则
微信支付:C#计算签名
C#日志Log写入
C# RestSharp上传和下载图片
C# MEF插件化开发
C#操作 配置文件*.ini
必须使用适当的属性或方法修改referer标头
YES-Win Winform开发框架 自定义查询方法并在表格中展示
RabbitMQ服务器环境搭建方法(Windows)
JS合并两个数组的3种方法详解

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码