FileInfo f = new FileInfo("pathtofile.txt"); string ext = f.Extension; //returns txt
using System.IO; ... Dim fileName As String = "C:\mydir.old\myfile.ext" Dim extension As String extension = Path.GetExtension(fileName)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)