VB example
Module Program Public num1 As Integer Public num2 As Integer Public answer As Integer Sub Main(args As String()) Console.Write("Type a number and press Enter") num1 = Console.ReadLine() Console.Write("Type another number to add to it and press Enter") num2 = Console.ReadLine() answer = num1 + num2 Console.WriteLine("The answer is " & answer) Console.Write("Press any key to continue...") Console.ReadKey(True) End Sub End Module
How execute a javascript function:
Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load ' Load an HTML file or set the DocumentText property with your HTML content WebBrowser1.DocumentText = "" End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ' Execute the JavaScript function and retrieve the return value Dim result As Object = WebBrowser1.Document.InvokeScript("addNumbers", New Object() {5, 10}) If result IsNot Nothing Then MessageBox.Show($"Result from JavaScript function: {result.ToString()}", "JavaScript Result") Else MessageBox.Show("No result from JavaScript function", "JavaScript Result") End If End Sub End Class
Display the boot sector:
Imports System.IO Module Module1 Sub Main() ' Specify the path to the disk you want to read (e.g., "\\.\PhysicalDrive0" for the first physical drive) Dim diskPath As String = "\\.\PhysicalDrive0" ' Read the first sector (boot sector) of the disk Dim bootSectorData As Byte() = ReadBootSector(diskPath) ' Display the boot sector data DisplayBootSector(bootSectorData) Console.ReadLine() End Sub Function ReadBootSector(diskPath As String) As Byte() Dim bootSectorData(511) As Byte ' 512 bytes for the boot sector Try Using fileStream As New FileStream(diskPath, FileMode.Open, FileAccess.Read) ' Read the first 512 bytes (boot sector) fileStream.Read(bootSectorData, 0, 512) End Using Catch ex As Exception Console.WriteLine("Error reading boot sector: " & ex.Message) End Try Return bootSectorData End Function Sub DisplayBootSector(bootSectorData As Byte()) ' Display the boot sector data as hexadecimal values Console.WriteLine("Boot Sector Data (Hexadecimal):") For i As Integer = 0 To bootSectorData.Length - 1 Console.Write($"{bootSectorData(i):X2} ") ' Print a newline after every 16 bytes for better readability If (i + 1) Mod 16 = 0 Then Console.WriteLine() End If Next End Sub End Module