Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net481</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Option Strict On

Public Class Form1

Public Shared Sub Main()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' SetFormTitle()
' SetFormIcon()
Expand Down Expand Up @@ -80,7 +84,7 @@ Public Class Form1

'<snippet4>
Sub PlayFormGreeting()
My.Computer.Audio.Play(My.Resources.Form1Greeting,
My.Computer.Audio.Play(My.Resources.Form1Greeting,
AudioPlayMode.Background)
End Sub
'</snippet4>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net481-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Resources.Extensions" Version="9.0.7" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net481-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ Option Strict On

Public Class Form1

Dim loginForm As LoginForm1

Public Shared Sub Main()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' <snippet4>
My.Forms.LoginForm1.ShowDialog()
loginForm.ShowDialog()
' Check if the user was authenticated.
If My.User.IsAuthenticated Then
Me.Label1.Text = "Authenticated " & My.User.Name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net481-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Resources.Extensions" Version="9.0.7" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Option Strict On
Option Explicit On
Imports System.Windows.Forms

Class Class1
Public Shared Sub Main()
End Sub

Public Sub testClock()
'<snippet21>
MsgBox("Current local time: " & My.Computer.Clock.LocalTime)
Expand All @@ -18,18 +22,18 @@ Class Class1
Loop
End Sub

Private Function IsTimeUp(
ByVal startTicks As Integer,
ByVal seconds As Integer
Private Function IsTimeUp(
ByVal startTicks As Integer,
ByVal seconds As Integer
) As Boolean
' This function throws an overflow exception if the
' tick count difference is greater than 2,147,483,647,
' about 24 days for My.Computer.Clock.TickCount.

' Use UInteger to simplify the code for roll over.
Dim uStart As UInteger =
Dim uStart As UInteger =
CUInt(CLng(startTicks) - Integer.MinValue)
Dim uCurrent As UInteger =
Dim uCurrent As UInteger =
CUInt(CLng(My.Computer.Clock.TickCount) - Integer.MinValue)

' Calculate the tick count difference.
Expand All @@ -52,50 +56,50 @@ Class Class1

'<snippet17>
Sub PlaySystemSound()
My.Computer.Audio.PlaySystemSound(
My.Computer.Audio.PlaySystemSound(
System.Media.SystemSounds.Asterisk)
End Sub
'</snippet17>

'<snippet16>
Sub PlayBackgroundSoundResource()
My.Computer.Audio.Play(My.Resources.Waterfall,
My.Computer.Audio.Play(My.Resources.Waterfall,
AudioPlayMode.WaitToComplete)
End Sub
'</snippet16>

'<snippet15>
Sub PlayBackgroundSoundFile()
My.Computer.Audio.Play("C:\Waterfall.wav",
My.Computer.Audio.Play("C:\Waterfall.wav",
AudioPlayMode.WaitToComplete)
End Sub
'</snippet15>

'<snippet14>
Sub PlaySoundResource()
My.Computer.Audio.Play(My.Resources.Waterfall,
My.Computer.Audio.Play(My.Resources.Waterfall,
AudioPlayMode.WaitToComplete)
End Sub
'</snippet14>

'<snippet13>
Sub PlaySoundFile()
My.Computer.Audio.Play("C:\Waterfall.wav",
My.Computer.Audio.Play("C:\Waterfall.wav",
AudioPlayMode.WaitToComplete)
End Sub
'</snippet13>

'<snippet12>
Sub PlayLoopingBackgroundSoundResource()
My.Computer.Audio.Play(My.Resources.Waterfall,
My.Computer.Audio.Play(My.Resources.Waterfall,
AudioPlayMode.BackgroundLoop)
End Sub
'</snippet12>

'<snippet19>
'<snippet11>
Sub PlayLoopingBackgroundSoundFile()
My.Computer.Audio.Play("C:\Waterfall.wav",
My.Computer.Audio.Play("C:\Waterfall.wav",
AudioPlayMode.BackgroundLoop)
End Sub
'</snippet11>
Expand All @@ -121,35 +125,35 @@ Class Class1
MsgBox("Computer name: " & My.Computer.Name)
'</snippet1>
'<snippet2>
MsgBox("Computer's available physical memory: " &
MsgBox("Computer's available physical memory: " &
My.Computer.Info.AvailablePhysicalMemory)
'</snippet2>
'<snippet3>
MsgBox("Computer's available virtual memory: " &
MsgBox("Computer's available virtual memory: " &
My.Computer.Info.AvailableVirtualMemory)
'</snippet3>
'<snippet4>
MsgBox("Computer's UI culture name: " &
MsgBox("Computer's UI culture name: " &
My.Computer.Info.InstalledUICulture.DisplayName)
'</snippet4>
'<snippet5>
MsgBox("Computer's operating system name: " &
MsgBox("Computer's operating system name: " &
My.Computer.Info.OSFullName)
'</snippet5>
'<snippet6>
MsgBox("Computer's operating system platform: " &
MsgBox("Computer's operating system platform: " &
My.Computer.Info.OSPlatform)
'</snippet6>
'<snippet7>
MsgBox("Computer's operating system version: " &
MsgBox("Computer's operating system version: " &
My.Computer.Info.OSVersion)
'</snippet7>
'<snippet8>
MsgBox("Computer's available physical memory: " &
MsgBox("Computer's available physical memory: " &
My.Computer.Info.TotalPhysicalMemory)
'</snippet8>
'<snippet9>
MsgBox("Computer's available virtual memory: " &
MsgBox("Computer's available virtual memory: " &
My.Computer.Info.TotalVirtualMemory)
'</snippet9>

Expand Down
Loading