I am trying to get the machine name of the computer that is running my application but i keep getting this error (it's on the line that is in bold):
Object reference not set to an instance of an object.
VB Code:
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AxAnimation1.Open(Application.StartupPath & "\EARTH_SPIN.avi") MachineName = Space$(64) CompNameSize = Len(MachineName) [B]Compname = GetComputerName(MachineName, CompNameSize)[/B] Compname = Trim(MachineName) Label1.Text = Compname End Sub
It looks like i needed to declare somethin....i think. Does anyone see a problem?





Reply With Quote