如何找到一个文件的扩展名? [英] How to find extension of a file?

查看:185
本文介绍了如何找到一个文件的扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网络应用程序(asp.net,C#)本人上传的视频文件中的一个页面,但我想只上传FLV视频。如何当我上传其他分机视频我可以限制帮我请。

in my web application (asp.net,c#) i am uploading video file in a page but i want to upload only flv videos. how can i restrict when i upload other extension videos help me please.

推荐答案

<一个href=\"http://msdn.microsoft.com/en-us/library/system.io.path.getextension.aspx\">Path.GetExtension

string myFilePath = @"C:\MyFile.txt";
string ext = Path.GetExtension(myFilePath);
// ext would be ".txt"

这篇关于如何找到一个文件的扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆