title: Getting file extension in google drive v3 and .net
body: <p>How to get file extensions in in Google Drive V3. I am using .net , here is the sample code to get the extension, but its not working! Any suggestions will help me a lot.</p>
  
  <p>UserCredential credential;</p>
  
  <pre><code>        using (var stream =
              new FileStream("client_secret.json", FileMode.Open, FileAccess.Read))
          {
              string credPath = System.Environment.GetFolderPath(
                  System.Environment.SpecialFolder.Personal);
              credPath = Path.Combine(credPath, ".credentials/drive-dotnet-quickstart");
  
              ClientSecrets sec = GoogleClientSecrets.Load(stream).Secrets;
  
              credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                  sec,
                  Scopes,
                  "user",
                  CancellationToken.None,
                  new FileDataStore(credPath, true)).Result;
              Console.WriteLine("Credential file saved to: " + credPath);
  
          }
  
  
          // Create Drive API service.
          var service = new DriveService(new BaseClientService.Initializer()
          {
              HttpClientInitializer = credential,
              ApplicationName = ApplicationName,
          });
  
          // Define parameters of request.
          FilesResource.ListRequest listRequest = service.Files.List();
          listRequest.PageSize = 10;
          // List files.
          IList&lt;Google.Apis.Drive.v3.Data.File&gt; files = listRequest.Execute().Files;
  
          Console.WriteLine("Files:");
          if (files != null &amp;&amp; files.Count &gt; 0)
          {
              foreach (var file in files)
              {
                  Console.WriteLine(file.FileExtension);
                  Console.WriteLine(file.FullFileExtension);
  </code></pre>