| | |
Getting File Extension
Please support our C# advertiser: Intel Parallel Studio Home
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: add custom control to outlook toolbar in VSTO
| Thread Tools | Search this Thread |
.net access algorithm animation array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees development dll draganddrop drawing encryption enum event excel file filename files form format forms function gdi+ gis gtk hash image index input install java label list listbox mandelbrot math mouseclick mysql operator outlook2003 path photoshop picturebox pixelinversion pixelminversion post programming radians regex remoting richtextbox server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wia windows winforms wpf xml






