c# get file extension
string myFilePath = @"C:MyFile.txt";
string ext = Path.GetExtension(myFilePath);
// ext would be ".txt"
c# get file extension
string myFilePath = @"C:MyFile.txt";
string ext = Path.GetExtension(myFilePath);
// ext would be ".txt"
HOW TO CALL AN EXTENSION METHOD FOR VIEW C#
<pages>
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="System.Collections.Generic" />
<add namespace="MyProject.Extensions" />
</namespaces>
</pages>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us