Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net
- Imports System.Text
- Imports System.Net.Sockets
- Imports System.Diagnostics
- Imports System.IO
- Public Class frmConsole
- Dim inter As String
- Dim port As Integer
- Dim packets As Integer
- Public SAPI As Object
- Public compspeak
- Public Function speak()
- Dim SAPI
- SAPI = CreateObject("SAPI.spvoice")
- SAPI.Volume = 100
- SAPI.speak(compspeak)
- End Function
- Private Sub txtCommands_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles txtCommands.KeyDown
- Dim fileClear As String
- If e.KeyCode = Keys.Enter Then
- If txtCommands.Text.Contains("phOScd.clear-") Or txtCommands.Text.Contains("phoscd.clear") Then
- fileClear = txtCommands.Text.Split("-")(1)
- If My.Computer.FileSystem.FileExists(fileClear) Then
- My.Computer.FileSystem.WriteAllText(fileClear, "", False)
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- txtItems.AppendText("File: " & fileClear & " cleared" & vbNewLine & vbNewLine)
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- Else
- txtItems.AppendText("File: " & fileClear & " not found" & vbNewLine & vbNewLine)
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- End If
- ElseIf txtCommands.Text.Contains("phOS.end") Or txtCommands.Text.Contains("phos.end") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text)
- Application.Exit()
- ElseIf txtCommands.Text.Contains("help") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- txtItems.AppendText("Command: 'phOScd.clear' Purpose: Clear specified text file" & vbNewLine)
- txtItems.AppendText("Syntax: phOScd.clear-C:\example.txt" & vbNewLine & vbNewLine)
- txtItems.AppendText("Command: 'phOS.end' Purpose: Exit phOS" & vbNewLine & vbNewLine)
- txtItems.AppendText("Command: 'stress' Purpose: Send packets to stress an IP address" & vbNewLine)
- txtItems.AppendText("Syntax: stress 127.0.0.1 80 : 100 ('stress' IP Port : Packets)" & vbNewLine & vbNewLine)
- txtItems.AppendText("Command: 'IP.get' Purpose: Get a websites IP address" & vbNewLine)
- txtItems.AppendText("Syntax: IP.get www.google.com" & vbNewLine & vbNewLine)
- txtItems.AppendText("Command: 'myInfo.get' Purpose: Display information about your machine" & vbNewLine & vbNewLine)
- txtItems.AppendText("Command: 'files.list' Purpose: View Files on Drive" & vbNewLine & "Syntax: files.list(desktop)" & vbNewLine & vbNewLine)
- txtItems.AppendText("Command: 'launch' Purpose: Launch an app from the console" & vbNewLine & "Syntax: launch@calculator" & vbNewLine & vbNewLine)
- txtItems.AppendText("Command: 'say' Purpose: Have The Computer Talk" & vbNewLine & "Syntax: say hello world" & vbNewLine & vbNewLine)
- txtItems.AppendText("Command: 'goTo' Purpose: opens a website in default browser" & vbNewLine & "Syntax: goTo http://www.google.com (URL must include http://)" & vbNewLine & vbNewLine)
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- ElseIf txtCommands.Text.Contains("stress ") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- If txtCommands.Text.Contains(" : ") And txtCommands.Text.IndexOf(" ") >= 4 Then
- inter = txtCommands.Text.Split(" ")(1)
- port = txtCommands.Text.Split(" ")(2)
- packets = txtCommands.Text.Split(":")(1)
- If inter <> Nothing And port <> Nothing And packets <> Nothing Then
- Timer1.Start()
- Else
- txtItems.AppendText("Syntax: stress 127.0.0.1 80 : 100 ('stress':IP:Port:Packets)" & vbNewLine & vbNewLine)
- End If
- Else
- txtItems.AppendText("Syntax: stress 127.0.0.1 80 : 100 ('stress':IP:Port:Packets)" & vbNewLine & vbNewLine)
- End If
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- ElseIf txtCommands.Text.Contains("stop") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- If Timer1.Enabled = True Then
- Timer1.Enabled = False
- End If
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- ElseIf txtCommands.Text.Contains("IP.get") Or txtCommands.Text.Contains("ip.get") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- Dim websiteURL As String
- websiteURL = txtCommands.Text.Split(" ")(1)
- Dim hostname As IPHostEntry = Dns.GetHostEntry(websiteURL)
- Dim ip As IPAddress() = hostname.AddressList
- txtItems.AppendText("IP of " & websiteURL & " is " & ip(0).ToString & vbNewLine & vbNewLine)
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- ElseIf txtCommands.Text.Contains("clear") Then
- txtItems.Clear()
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- btnStart.PerformClick()
- ElseIf txtCommands.Text.Contains("myInfo.get") Or txtCommands.Text.Contains("myinfo.get") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- Dim myIPaddress As String
- Dim tmpHostName As String = System.Net.Dns.GetHostName()
- myIPaddress = System.Net.Dns.GetHostByName(tmpHostName).AddressList(0).ToString()
- Dim myIPaddress2 As String
- Dim tmpHostName2 As String = System.Net.Dns.GetHostName()
- myIPaddress2 = System.Net.Dns.GetHostEntry(tmpHostName2).AddressList(0).ToString()
- txtItems.AppendText("Your Local IP is: " & myIPaddress & vbNewLine & "Your Public IP is: " & myIPaddress2 & vbNewLine & "Computer Name: " & My.Computer.Name & vbNewLine & vbNewLine)
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- ElseIf txtCommands.Text.Contains("files.list(programs)") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- For Each foundFile As String In My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.SpecialDirectories.ProgramFiles)
- txtItems.AppendText(foundFile)
- Next
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- ElseIf txtCommands.Text.Contains("files.list(desktop)") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- For Each foundFile As String In My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.SpecialDirectories.Desktop)
- txtItems.AppendText(foundFile)
- Next
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- ElseIf txtCommands.Text.Contains("say") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- Dim sayCom As String
- sayCom = txtCommands.Text.Replace("say", " ")
- compspeak = sayCom
- speak()
- txtItems.AppendText("Computer:" & sayCom & vbNewLine & vbNewLine)
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- ElseIf txtCommands.Text.Contains("goTo") Or txtCommands.Text.Contains("goto") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- Dim webURL As String
- webURL = txtCommands.Text.Split(" ")(1)
- If txtCommands.Text.Contains("http") And webURL <> Nothing Then
- Process.Start(webURL)
- Else
- txtItems.AppendText("Make sure the website is valid and contains 'http://' before the URL" & vbNewLine & vbNewLine)
- End If
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- ElseIf txtCommands.Text.Contains("@") Then
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- Dim app As String
- app = txtCommands.Text.Split("@")(1)
- If app <> Nothing And txtCommands.Text.Contains("@") Then
- If app.Contains("binary") Then
- frmBinary.Show()
- txtItems.AppendText("Launching app BinaryTranslator" & vbNewLine & vbNewLine)
- ElseIf app.Contains("calculator") Then
- frmCalculator.Show()
- txtItems.AppendText("Launching app calculator" & vbNewLine & vbNewLine)
- ElseIf app.Contains("notes") Then
- frmWord.Show()
- txtItems.AppendText("Launching app notes" & vbNewLine & vbNewLine)
- ElseIf app.Contains("messenger") Then
- frmMessenger.Show()
- txtItems.AppendText("Launching app messenger" & vbNewLine & vbNewLine)
- ElseIf app.Contains("mail") Then
- frmMail.Show()
- txtItems.AppendText("Launching app mail" & vbNewLine & vbNewLine)
- ElseIf app.Contains("gpa") Then
- frmGPACalculator.Show()
- txtItems.AppendText("Launching app gpa" & vbNewLine & vbNewLine)
- ElseIf app.Contains("chat") Then
- frmChatBot.Show()
- txtItems.AppendText("Launching app chat bot" & vbNewLine & vbNewLine)
- ElseIf app.Contains("browser") Then
- frmBrowser.Show()
- txtItems.AppendText("Launching app browser" & vbNewLine & vbNewLine)
- ElseIf app.Contains("finals") Then
- frmFinals.Show()
- txtItems.AppendText("Launching app finals calculator" & vbNewLine & vbNewLine)
- ElseIf app.Contains("watch") Then
- frmStopWatch.Show()
- txtItems.AppendText("Launching app stop watch" & vbNewLine & vbNewLine)
- ElseIf app.Contains("finals") Then
- frmFinals.Show()
- txtItems.AppendText("Launching app finals calculator" & vbNewLine & vbNewLine)
- Else
- txtItems.AppendText("Syntax: launch@calculator" & vbNewLine & vbNewLine)
- End If
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- End If
- Else
- txtItems.AppendText("P:\Console.ph>" & txtCommands.Text & vbNewLine & vbNewLine)
- txtItems.AppendText("'" & txtCommands.Text & "' is not recognized as an internal or external command. Type 'help' to recieve information on commands and their syntax's." & vbNewLine & vbNewLine)
- txtCommands.Clear()
- SendKeys.Send("{BACKSPACE}")
- End If
- txtItems.SelectionStart = txtItems.TextLength
- txtItems.ScrollToCaret()
- End If
- End Sub
- Private Sub frmConsole_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- btnStart.PerformClick()
- txtCommands.Select()
- End Sub
- Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
- Timer1.Interval = packets
- Try
- txtItems.AppendText("Stressing " + inter + " with packet number: ")
- txtItems.AppendText(My.Computer.Info.AvailableVirtualMemory & " (type 'stop' to end process)" & vbNewLine & vbNewLine)
- txtItems.AppendText("")
- Dim udpClient As New UdpClient
- Dim GLOIP As IPAddress
- Dim bytCommand As Byte() = New Byte() {}
- GLOIP = IPAddress.Parse(inter)
- udpClient.Connect(GLOIP, port)
- udpClient.Send(bytCommand, bytCommand.Length)
- txtItems.SelectionStart = txtItems.TextLength
- txtItems.ScrollToCaret()
- Finally
- End Try
- End Sub
- Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles btnStart.Click
- txtItems.AppendText("Welcome to phOS Developer Console (v2.1)" & vbNewLine)
- txtItems.AppendText("Type 'help' to get started" & vbNewLine)
- txtItems.AppendText("-------------------------------------------------------------" & vbNewLine)
- End Sub
- Private Sub txtItems_Click(sender As Object, e As System.EventArgs) Handles txtItems.Click
- txtCommands.Select()
- End Sub
- Private Sub frmConsole_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
- If Me.Size.Height >= 602 And Me.Size.Width >= 1026 Then
- txtItems.Font = New Font("Microsoft Sans Serif", 12.5)
- Else
- txtItems.Font = New Font("Microsoft Sans Serif", 9)
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement