I have two following rows of code:
Microsoft.VisualBasic.Interaction.Beep()
or
Microsoft.VisualBasic.Beep()
The result is the same in this two rows.
what is Interaction class?And when shold i use it?
Thank you in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Those two lines result in exactly the same code being generated. Which one you choose is a matter of style. Personally I would choose to simply use the
Beep()command in the abscence of a namespace qualifierBetween the two choices you presented though I would choose
Microsoft.VisualBasic.Interaction.Beep()overMicrosoft.VisualBasic.Beep(). The former is the fully qualified name of the method and it’s completely unambiguous to the reader. The latter though is using a trick of VB.Net name resolution and one that would likely fool even the experienced VB.Net user.