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]

Htet Naing

Htet Naing
Moderator



Moderator
ဒီ Topic မွာ ကြ်န္ေတာ္ေလ့လာရင္း သိရွိခဲ့တဲ့ coding အတိုအထြာေလးေတြကို ၿပန္္လည္မွ်ေ၀ ေပးသြားပါမယ္။ ကြ်န္ေတာ္မသိေသးတဲ့ coding ေတြကို သိတဲ့ member မ်ားအေနနဲ ့လည္း ဒီ topic ေအာက္မွာ ဆက္လက္မွ်ေ၀ေပးေစခ်င္ပါတယ္။

ပထမဦးဆံုး Dir$() ဆိုတာေလးအေၾကာင္းေၿပာပါမယ္။ သူ ့ကိုေတာ့ ကြ်န္ေတာ္တို ့လမ္းေၾကာင္းတစ္ခုမွာ file တစ္ခုရွိမရွိ စစ္္ခ်င္တဲ့အခါမွာ သံုးလို ့ရမယ့္ coding ေလးပါ။ ေအာက္ကပံုစံအတိုင္း အသံုးၿပဳႏိုင္ပါတယ္။
Code:

If Dir$(Application.StartupPath & “\sample.jpg”)<>”  “ Then
   MessageBox.Show(“The file is under the specified directory.”, “File Exist”)
Else
   MessageBox.Show(“The file is not under the specified directory.”, “No File”)
End If

Bin ေအာက္က Debug ေအာက္မွာ sample.jpg ရွိရင္ ပထမ MsgBox ၿဖစ္တဲ့ The file is under the specified directory. ဆိုတဲ့ MsgBox ကိုၿပမွာၿဖစ္ၿပီး မရွိခဲ့ရင္ေတာ့ The file is not under the specified directory. ဆုိတဲ့ MsgBox ကိုၿပမွာၿဖစ္ပါတယ္။

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 | Forumotion.com