如何检查我的网址扩展.pdf不是 [英] how to check my url extenction .pdf are not

查看:65
本文介绍了如何检查我的网址扩展.pdf不是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public void setUrl(string url)

{



}





我的上面的网址我正在低于路径。

\\abc\File\CMS \2013 \\\\\\\\\\\\\\\\\\\\\\\\\\\\


基于此我检查网址是否包含.pdf不在下一步。我该怎么写这个条件...



请给我任何建议

public void setUrl(string url)
{

}


in my above url i am getting below path.
\\abc\File\CMS\2013\3\6\Scan\ISTQB f Syllabus.pdf


based on this i have check whether the url contains .pdf are not in next step. how can i write the condition for this...

please send me any suggestions

推荐答案

* ryanb是对的。

使用以下代码格式:

*ryanb is right.
Use following code format:
string url = "/temp/temp.pdf";
           if (url.EndsWith(".pdf"))
               Console.WriteLine("It is a Pdf file.");
           else
               Console.WriteLine("Not pdf file.");


这篇关于如何检查我的网址扩展.pdf不是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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