“Path”这个名称在当前上下文中不存在 [英] The name 'Path' does not exist in the current context

查看:250
本文介绍了“Path”这个名称在当前上下文中不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用文件上传控件上传文件,

因为我需要将该文件的扩展名保存到我的数据库

我使用的是

I used file upload control to upload the files,
for that I need to save extension of that file to my database
for that I used

string str= Path.GetExtension(FileUpload1.PostedFile.FileName);





当我跑我的应用程序我收到了以下错误

当前上下文中不存在名称'Path'

为什么这是什么意思?



when I run my app I am getting the follwoing error
"The name 'Path' does not exist in the current context"
why what does it mean?

推荐答案

使用



Use

System.IO.Path


为此只有一个解决方案

使用命名空间

System.IO;
for this there is only one solution that is
use namespace
System.IO;


这篇关于“Path”这个名称在当前上下文中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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