Click here to Skip to main content
13,293,474 members (63,467 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
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);


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?
Posted 3-Feb-11 20:26pm
Updated 16-Jun-17 9:18am
m@dhu29.7K
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Use

System.IO.Path
  Permalink  
Comments
SAKryukov 4-Feb-11 1:53am
   
Simple as that - a 5.
I would also said "shame on you" to OP :-)
--SA
sasirekhareddy 7-Sep-13 7:48am
   
works fine
Sandeep Mewara 4-Feb-11 3:37am
   
Common OP is a beginner, it happens! :)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

for this there is only one solution that is
use namespace
System.IO;
  Permalink  
Comments
balu.n6 3-Apr-12 9:27am
   
i tried but doesn't solve the problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.171207.1 | Last Updated 16 Jun 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100