Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7770217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:21:23+00:00 2026-06-01T16:21:23+00:00

I am using the example from: http://msdn.microsoft.com/en-us/library/system.io.driveinfo(v=vs.80).aspx To print drive information to a console

  • 0

I am using the example from: http://msdn.microsoft.com/en-us/library/system.io.driveinfo(v=vs.80).aspx

To print drive information to a console window. I want to check if d.Name contains “T”. If it does, I wan’t to run an app. If it doesn’t do nothing. Here is the code I’ve been trying. (The default code from the above linked example prints to a command window)

(d.Name.IsLetter(T)) is the part I’m having trouble with. Can anyone advise?

DriveInfo[] allDrives = DriveInfo.GetDrives();

    foreach (DriveInfo d in allDrives)
    {
        Console.WriteLine("Drive {0}", d.Name);

         if (d.Name.IsLetter(T))
            {
                Console.WriteLine("Run App.");
                notePad.Start();
            }//end if
            else
            {
                Console.WriteLine("Do Nothing.");
            }//end else
        Console.WriteLine("  File type: {0}", d.DriveType);
        if (d.IsReady == true)
        {
            Console.WriteLine("  Volume label: {0}", d.VolumeLabel);
            Console.WriteLine("  File system: {0}", d.DriveFormat);
            Console.WriteLine(
                "  Available space to current user:{0, 15} bytes",
                d.AvailableFreeSpace);

            Console.WriteLine(
                "  Total available space:          {0, 15} bytes",
                d.TotalFreeSpace);

            Console.WriteLine(
                "  Total size of drive:            {0, 15} bytes ",
                d.TotalSize);
        }//end if
    }//end for

}//end main
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:21:24+00:00Added an answer on June 1, 2026 at 4:21 pm

    You want d.Name.Contains("T")

    There is a Char.IsLetter() method, but that only checks whether the argument is a “letter” (and not digit or symbol etc)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this example of the WMI: http://msdn.microsoft.com/en-us/library/aa390423%28v=vs.85%29.aspx I retrieved information from the
I see an example from the website http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser%28v=VS.90%29.aspx Here they are using a statement
I took the code from this example. http://msdn.microsoft.com/en-us/library/2tw134k3.aspx What I am wondering (and I've
I'm trying to make a working program from this example: http://msdn.microsoft.com/en-us/library/ms741870.aspx . I think
Here is an example of using a SqlUserDefinedAggregate : http://msdn.microsoft.com/en-us/library/91e6taax(v=vs.80).aspx Which allows you to
I'm trying to learn how from this site http://msdn.microsoft.com/en-us/library/cc265158(v=vs.95).aspx but the code won't compile
I dont understand : MSDN says http://msdn.microsoft.com/en-us/library/system.string.intern.aspx Consequently, an instance of a literal string
I've taken the most basic example of setting up a hosted endpoint ... http://msdn.microsoft.com/en-us/library/ms731758.aspx
It says here msdn.microsoft.com/en-us/library/system.io.stream.read.aspx that the Stream.Read and Stream.Write methods both advance the position/offset
In this document, http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#paths To make these device objects accessible by Windows applications, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.