File Stream C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
public static class IOExtensions
{
    public static string FullNameWithoutExtension(this FileInfo file)
    {
        int length = file.FullName.LastIndexOf('.');
        if (length == -1)
        {
            return file.FullName;
        }
        return file.FullName.Substring(0, length);
    }
}