Flylib.com

Books Software

 
 
 

PerformanceData Property


PerformanceData Property

Location

My.Computer.Registry.PerformanceData

Syntax

Dim result As Microsoft.Win32.RegistryKey = _
       My.Computer.Registry.PerformanceData

Description

The PerformanceData property returns a Microsoft.Win32.RegistryKey object that refers to the HKEY_PERFORMANCE_DATA location in the Windows registry. This key refers to information that is not actually stored in the registry, but the registry is the access point for this dynamically generated data. The data includes performance counts and statistics, many of which are displayed through the Performance control panel applet.

Usage at a Glance

  • This property is read-only.

  • You must have sufficient security permissions to read or write keys and values in the registry.

Related Framework Entries

  • Microsoft.VisualBasic.MyServices.RegistryProxy.PerformanceData Property

  • Microsoft.Win32.Registry.PerformanceData Property

See Also

ClassesRoot Property, CurrentConfig Property, CurrentUser Property, DynData Property, GetValue Method, LocalMachine Property, Registry Object, SetValue Method, Users Property



Ping Method

Location

My.Computer.Network.Ping

Syntax

Dim result As Boolean = My.Computer.Network.Ping(


host


[,


timeout


])

or:

Dim result As Boolean = My.Computer.Network.Ping(


uri


[,


timeout


])



host (required in syntax 1; String)

The IP address, Internet domain, URL, or computer name of the system to ping.



uri (required in second syntax; System.Uri)

The uniform resource identifier of the system to ping.



timeout (optional; Integer)

The number of milliseconds to wait before skipping a ping request. By default, the timeout is 500 milliseconds .

Description

The Ping method can be used to test for the presence of another system by making an ICMP protocol echo request over an IP network. This method returns TRue if the destination system was successfully Ping'd or False on a lack of success.

Usage at a Glance

Even if the Ping method returns False , the destination system may still be running and on the network. Causes for failure include the ping protocol being turned off on the target system, the ping request being blocked by a firewall, or a failure of the packet to reach the target system due to other network issues.

Related Framework Entries

  • Microsoft.VisualBasic.Devices.Network.Ping Method

  • System.Net.NetworkInformation.Ping Class

See Also

Network Object



Play Method

Location

My.Computer.Audio.Play

Syntax

My.Computer.Audio.Play(


location


[,


playMode


])

or:

My.Computer.Audio.Play(


data


,


playMode


)

or:

My.Computer.Audio.Play(


stream


,


playMode


)



location (required; String)

The path to the sound file.



data (required in syntax 2; Byte array)

The binary content of a sound file stored in a Byte array.



stream (required in syntax 3; Stream)

The binary content of a sound file accessed through a System.IO.Stream object.



playMode (optional in syntax 1; AudioPlayMode enumeration)

The method by which the sound should be played . One of the following Microsoft.VisualBasic.AudioPlayMode enumeration values.

Value

Description

Background

Starts playing the sound in the background one time. The program continues with the next source-code statement.

BackgroundLoop

Starts playing the sound in the background in a loop until stopped with the My.Computer.Audio.Stop method. The program continues with the next source-code statement.

WaitToComplete

Plays the sound but does not continue with the next source-code statement until the playing of the sound ends.


If omitted, the default value is Background .

Description

The Play method plays a sound (WAV) through the system speakers . The WAV sound content can be accessed as a file, a Byte array, or a Stream .

Usage at a Glance

  • This method is only valid in non-server applications.

  • Using an invalid or empty data source will cause an exception, as will using an invalid play mode.

  • Trying to play a file-based sound without sufficient privileges will cause an exception.

Example

The following example plays a disk-based WAV file and waits for it to complete.

My.Computer.Audio.Play("C:\YouWin.wav", _
   AudioPlayMode.WaitToComplete)

Related Framework Entries

  • Microsoft.VisualBasic.Devices.Audio.Play Method

  • System.Media.SoundPlayer Class

  • System.Media.SoundPlayer.Play Method

  • System.Media.SoundPlayer.PlayLooping Method

  • System.Media.SoundPlayer.PlaySyncMethod

See Also

Audio Object, PlaySystemSound Method, Stop Method