2 Replies - 1527 Views - Last Post: 18 January 2013 - 12:34 AM Rate Topic: -----

#1 irfan_r  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 30-October 12

GetComputerName / vb.net

Posted 17 January 2013 - 11:47 PM

Hi All
i have problem when getcomputername

my code
Dim buffer As String
buffer = Space$(512)
Dim size As Long = buffer.Length
If GetComputerName(buffer, size) Then
x_computer_name = Mid(buffer, 1, size)
End If


error : Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

can you help me.
thank's

This post has been edited by macosxnerd101: 17 January 2013 - 11:51 PM
Reason for edit:: Please use code tags

Is This A Good Question/Topic? 0
  • +

Replies To: GetComputerName / vb.net

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10662
  • View blog
  • Posts: 39,590
  • Joined: 27-December 08

Re: GetComputerName / vb.net

Posted 17 January 2013 - 11:52 PM

You've been around long enough to know the drill. Please use code tags. Also, the Site Questions forum isn't for programming help questions. Moved to VB.NET.
Was This Post Helpful? 0
  • +
  • -

#3 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: GetComputerName / vb.net

Posted 18 January 2013 - 12:34 AM

View Postirfan_r, on 18 January 2013 - 12:47 AM, said:

i have problem when getcomputername

Dim compname as String = SystemInformation.ComputerName


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1