Visual Basic Code Snippets and Utilities In the following section, you can find a variety of Visual Basic code samples. For every sample, you can download the entire project for opening in Visual Basic 6.0. Dim a As Integer = 10 Dim b As Integer = 8 Dim c As Integer = 6 Dim firstPattern, secondPattern, thirdPattern As Integer firstPattern = (a And b) secondPattern = (a And c) thirdPattern = (b And c) The preceding example produces results of 8, 2, and 0, respectively. Logical/Bitwise Operators (Visual Basic) Operator Precedence in Visual. C without any qualification is generic and doesn’t assume any particular platform. C was first released in the mid-1980’s; the 1990 version (2.0) was the base version until it was officially updated in 2011. C# is ranked 9th while Visual Basic is ranked 61st. The most important reason people chose C# is: Where other languages invoke the feeling of being a product of organic growth over time, C# just feels like an incredibly well-designed language where everything has its purpose and almost nothing is non-essential. C# basics covers the basics of C# programming. We work with variables, constants and basic data types. We read and write to the console; we mention variable interpolation.
This is one of my favorite question during interview as a part of .NET Framework fundamental, and I generally received very mixed response. Can we have both c# and visual basic project in same solution ?. The response I used to received “No, it is not possible”, “Yes. we can do it for web project” etc. This question comes up when we discuss about very basic of CLS, CTS, MSIL etc. While developers having understanding with these terminologies, most of them failed to understand this basic question which actually related to them.
All right! So, what is the answer ? – Of Course ! Why not ? We can have a Solution, with different types of languages and they can refer. Just like a another reference library; in fact it could be any other language supported by the Framework. When they compiles, all the languages uses their native Compiler ( C# –> CSC Compiler, VB –> VB Compiler ) to generates the IL and that is understandable by other languages.
Here is one simple walkthrough on using this..
- Run a new instance of Visual Studio
- Create a new C# Console Application Project.
- Add a new “Visual Basic Project” using “Add New Project” dialog window”
- Add the VB Class Library Project as Reference to C# Project.
This is how the solution should look like:
101 Visual Basic And C# Code Samples List

101 Visual Basic And C# Code Samples Download

Visual Basic C# Download

Now, you can write some dummy code block , one method that write something on console, and one method to add two number.
Here is the C# Code block, that calls the above VB methods which included as part of reference assembly.
Once you run the application, this is how your output will come.
The application execution code map would look like as below.
To take an inside look, if you open both the VB Library, C# Code using ILDASM,now; you should be able to relate how IL code is getting called with same data type over different language.
Hope this will give you a good understanding.
How To Do it for ASP.NET Web Application ?A Beginner’s Guide to ASP.NET Application Folders
Comments are closed.