Logo F2FInterview

VB .NET Interview Questions

Q   |   QA

Just to give an understanding of what the above question means see the below code :-

int val = 0;
MessageBox.Show(val.ToString());
MessageBox.Show(Convert.ToString(val));


We can convert the integer "val" using "val.ToString()" or "Convert.ToString" so what's the difference.

The basic difference between them is "Convert" function handles NULLS while "val.ToString()" does not.

It will throw a NULL reference exception error. So as good coding practice using "Convert" is always safe.

By design .NET embeds rich Meta data inside the executable code using MSIL. Any one can easily decompile your DLL back using tools like ILDASM (owned by Microsoft) or Reflector for .NET which is a third party. Secondly there are many third party tools which make this decompiling process a click away. So any one can easily look in to your assemblies and reverse engineer them back in to actual source code and understand some real good logic which can make it easy to crack your application.

The process by which you can stop this reverse engineering is using "obfuscation". It's a technique which will foil the decompilers. There are many third parties (XenoCode, Demeanor for .NET) which provide .NET obfuscation solution. Microsoft includes one that is Dotfuscator Community Edition with Visual Studio.NET.

CAS is part of .NET security model that determines whether or not a piece of code is allowed to run and what resources it can use while running. Example CAS will allow an application to read but not to write and delete a file or a resource from a folder.

Boxing permits any value type to be implicitly converted to type object or to any interface type implemented by value type. Boxing is a process in which object instances are created and copy values in to that instance.

Unboxing is vice versa of boxing operation where the value is copied from the instance in to appropriate storage location.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim RType As Type
Dim RObject As Object
Dim MyButtons As New Windows.Forms.Button()
RType = MyButtons.GetType()
For Each RObject In RType.GetMembers
LstDisplay.Items.Add(RObject.ToString())
Next
End Sub
End Class

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: