Myanmar IT Resource Forum
Myanmar IT Resource Forum
Myanmar IT Resource Forum

You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

sHa92

sHa92
Founder



Founder
က်ေနာ္ အခုေရးၿပမယ့္ Code ကေတာ့ Computer တစ္ခုရဲ႕ Drives ေတြကို ေဖာ္ၿပေပးပါမယ္။ ၿပီးရင္ အဲဒီ့ Drive ေတြနဲ႔ ဆက္စပ္တဲ့ အေၾကာင္းအရာေတြကိုပါေဖာ္ၿပေပးမွာပါ။
ေနရာေတာ္ေတာ္မ်ားမ်ားမွာ အသံုး၀င္ပါတယ္။

က်ေနာ္ အခုတေလာ Windows Application ေရးနည္းေတြ ေလ့လာေနလို႔ Code ေတြကို အခြင့္အခါသင့္သလို ရွဲေပးသြားမွၿဖစ္ပါတယ္။
လုိအပ္ခ်က္ေတြရိွရင္ က်ေနာ္နဲ႔ အတူၿဖည့္ၿပီးေတာ့ ေဆြးေႏြးေပးပါ။

ေအာ္ သံုးမယ့္ Program မွာ System.IO ဆုိတာကို ထည့္ဖို႔ေတာ့ မေမ့နဲ႔ေနာ္။
Code:

DriveInfo[] driv = DriveInfo.GetDrives();



foreach (DriveInfo d in driv)

{

    Console.WriteLine("Drive Name :"+ d.Name);

    Console.WriteLine("Drive Format :"+ d.DriveFormat);

}

http://www.myanmaritresource.info

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum

 

Forum create on Forumotion | ©phpBB | Free forum support | Report an abuse | Cookies | Forumotion.com