| | |
Getting File Extension
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
•
•
Join Date: Jul 2007
Posts: 276
Reputation:
Solved Threads: 37
You don't mention if you have to use substring to get the extension or if that is just the method to grab it you decided to use so I'll ask another question . . .
Is there any reason you are not using path.getextension() ?
You can get this info from a google search on C# path.getextension or msdn is here: http://msdn.microsoft.com/en-us/libr...extension.aspx
(wondering because .aspx is four while .doc is three etc.)
Is there any reason you are not using path.getextension() ?
C# Syntax (Toggle Plain Text)
extension = Path.GetExtension(fileName);
You can get this info from a google search on C# path.getextension or msdn is here: http://msdn.microsoft.com/en-us/libr...extension.aspx
(wondering because .aspx is four while .doc is three etc.)
Last edited by rapture; Jan 5th, 2009 at 5:42 pm.
After the last "." get the string is after
you may have file, its name readme.program.user.txt!!
It's the time to play with string class, you can also use regular expression and you can use FileInfo.
you may have file, its name readme.program.user.txt!!
It's the time to play with string class, you can also use regular expression and you can use FileInfo.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- .rdn file extension (Visual Basic 4 / 5 / 6)
- Anybody know anything about the '.wbo' file extension? (Database Design)
- Determine File Extension Type (Perl)
- File extension: How to display in Hexadecimal? (Windows NT / 2000 / XP)
- Is it possible to execute programs without “.exe� file extension? (Windows Software)
- Need help w/ file extension (Windows NT / 2000 / XP)
- Creating own file extension (Computer Science)
Other Threads in the C# Forum
- Previous Thread: file path name
- Next Thread: How do you connect to a sql database using C#
| Thread Tools | Search this Thread |
.net access algorithm animation array asp bitmap box c# check checkbox client combobox control conversion csharp customactiondata database datagrid datagridview dataset date/time datetime datetimepicker degrees directrobot display dll draganddrop drawing encryption enum excel file filename files form format formbox forms formupdate function gdi+ gtk hash image input install java list math mouseclick mp3 mysql native networking operator outlook2003 packaging path photoshop picturebox pixelinversion pixelminversion post print process programming radians regex remoting reporting richtextbox safari server sleep snooze socket sql statistics string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webcam wfa wia winforms wpf xml






