سلام بر برنامه نویسان عزیز 😉 در این مطلب از وب سایت پروگرم 98 کد گرفتن همه logical drive ها با متد GetLogicalDrives در سی شارپ را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
خروجی این کد به صورت زیر می باشد:
Here are your drives:
--> C:\
--> D:\
--> C:\
--> D:\
کد گرفتن همه logical drive ها با متد GetLogicalDrives در سی شارپ :
using System;
using System.IO;
class MaionClass
{
public static void Main(String[] args)
{
string[] drives = Directory.GetLogicalDrives();
Console.WriteLine("Here are your drives:");
foreach(string s in drives)
{
Console.WriteLine("--> {0}", s);
using System.IO;
class MaionClass
{
public static void Main(String[] args)
{
string[] drives = Directory.GetLogicalDrives();
Console.WriteLine("Here are your drives:");
foreach(string s in drives)
{
Console.WriteLine("--> {0}", s);