当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > 介绍几个ASP.NET中容易忽略但却很重要的方法函数

ASP.NET
Web服务器控件:LinkButton控件
Web服务器控件:ListBox控件
Web服务器控件:ListItem控件
Web服务器控件:Literal控件
Web服务器控件:Panel控件
Web服务器控件:PlaceHolder控件
Web服务器控件:RadioButton控件
Web服务器控件:RadioButtonList控件
Web服务器控件:BulletedList控件
Web服务器控件:Style控件
Web服务器控件:Table控件
Web服务器控件:TableCell控件
Web服务器控件:TableRow控件
Web服务器控件:TextBox控件
Web服务器控件:XML控件
Validation服务器控件:CompareValidator控件
Validation服务器控件:CustomValidator控件
Validation服务器控件:RangeValidator控件
Validation服务器控件:RegularExpressionValidator控件
Validation服务器控件:RequiredFieldValidator控件

介绍几个ASP.NET中容易忽略但却很重要的方法函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-11   浏览: 49 ::
收藏到网摘: n/a

给大家介绍几个.NET中Path类的几个方法:

1. Path.combine(string, string)
根据给出的两个路径, 返回一个路径.
例如:
string CompletePath = System.IO.Path.Combine(@"c:\MyApp", @"/upload/tech/20091011/20091011143312_f2fc990265c712c49d51a18a32b39f0c.jpg");
将会返回一个全路径 c:\MyApp\/upload/tech/20091011/20091011143312_f2fc990265c712c49d51a18a32b39f0c.jpg
第一个参数中有无"\"结尾都可以.

2. Path.GetExtension(string)
返回给定文件路径的扩展名.例如:
string FileExtention = System.IO.Path.GetExtention(@"C:\MyApp\/upload/tech/20091011/20091011143312_f2fc990265c712c49d51a18a32b39f0c.jpg");
将会返回 "jpg"

3. Path.GetFileName(string)
给出文件名的全路径,返回文件名(包括扩展名).例如:
string fileName = System.IO.Path.GetFileName(@"c:\MyApp\/upload/tech/20091011/20091011143312_f2fc990265c712c49d51a18a32b39f0c.jpg");
将会返回"/upload/tech/20091011/20091011143314_5ef698cd9fe650923ea331c15af3b160.jpg"