| | |
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 |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






