Added new Sys Info feature

Added System Info 'Dump to Text File' button onto the System Info form.
Don't worry, it's all working.
This commit is contained in:
TheUltimateHacker 2015-03-09 20:18:19 -04:00
parent 052319164e
commit 996b7ea76e
3 changed files with 57 additions and 26 deletions

View file

@ -546,7 +546,7 @@ Public Class File_Saver
End Select End Select
Select Case savingprogram Select Case savingprogram
Case "textpad" Case "textpad", "sysinf"
If fileex = ".txt" Then lvfiles.Items.Add(filename, filetype) If fileex = ".txt" Then lvfiles.Items.Add(filename, filetype)
Case "skinloader" Case "skinloader"
If fileex = ".skn" Then lvfiles.Items.Add(filename, filetype) If fileex = ".skn" Then lvfiles.Items.Add(filename, filetype)
@ -657,6 +657,20 @@ Public Class File_Saver
If txtfilename.Text = "" Then If txtfilename.Text = "" Then
Else Else
Select Case savingprogram Select Case savingprogram
Case "sysinf"
Dim sw As New IO.StreamWriter(lbllocation.Text & "/" & txtfilename.Text & ".txt")
sw.WriteLine("### SHIFTOS SYSTEM INFORMATION DUMP ###")
sw.WriteLine(" ")
sw.WriteLine("ShiftOS Version: " & ShiftOSDesktop.ingameversion)
sw.WriteLine("User Name: " & ShiftOSDesktop.username)
Dim PrcName As String
PrcName = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString", Nothing)
sw.WriteLine("CPU: " & PrcName)
sw.WriteLine("Random Access Memory (RAM): " & (String.Format("{0} Megabytes", System.Math.Round(My.Computer.Info.TotalPhysicalMemory / (1024 * 1024)), 2).ToString))
sw.Close()
Me.Close()
ShiftOSDesktop.refreshIcons()
Case "textpad" Case "textpad"
My.Computer.FileSystem.WriteAllText(lbllocation.Text & "/" & filename, TextPad.txtuserinput.Text, False) My.Computer.FileSystem.WriteAllText(lbllocation.Text & "/" & filename, TextPad.txtuserinput.Text, False)
TextPad.needtosave = False TextPad.needtosave = False

View file

@ -27,6 +27,8 @@ Partial Class systeminfo
Me.pullbs = New System.Windows.Forms.Timer(Me.components) Me.pullbs = New System.Windows.Forms.Timer(Me.components)
Me.pgcontents = New System.Windows.Forms.Panel() Me.pgcontents = New System.Windows.Forms.Panel()
Me.SysInfoBox = New System.Windows.Forms.GroupBox() Me.SysInfoBox = New System.Windows.Forms.GroupBox()
Me.SysInfoTextBox5 = New System.Windows.Forms.TextBox()
Me.SysInfoLabel5 = New System.Windows.Forms.Label()
Me.SysInfoBox2 = New System.Windows.Forms.TextBox() Me.SysInfoBox2 = New System.Windows.Forms.TextBox()
Me.SysInfoBox1 = New System.Windows.Forms.TextBox() Me.SysInfoBox1 = New System.Windows.Forms.TextBox()
Me.SysInfoLabel2 = New System.Windows.Forms.Label() Me.SysInfoLabel2 = New System.Windows.Forms.Label()
@ -50,8 +52,7 @@ Partial Class systeminfo
Me.pgbottomlcorner = New System.Windows.Forms.Panel() Me.pgbottomlcorner = New System.Windows.Forms.Panel()
Me.pgleft = New System.Windows.Forms.Panel() Me.pgleft = New System.Windows.Forms.Panel()
Me.titlebar = New System.Windows.Forms.Panel() Me.titlebar = New System.Windows.Forms.Panel()
Me.SysInfoLabel5 = New System.Windows.Forms.Label() Me.Button1 = New System.Windows.Forms.Button()
Me.SysInfoTextBox5 = New System.Windows.Forms.TextBox()
Me.pgcontents.SuspendLayout() Me.pgcontents.SuspendLayout()
Me.SysInfoBox.SuspendLayout() Me.SysInfoBox.SuspendLayout()
Me.GroupBox1.SuspendLayout() Me.GroupBox1.SuspendLayout()
@ -95,6 +96,25 @@ Partial Class systeminfo
Me.SysInfoBox.TabStop = False Me.SysInfoBox.TabStop = False
Me.SysInfoBox.Text = "ShiftOS" Me.SysInfoBox.Text = "ShiftOS"
' '
'SysInfoTextBox5
'
Me.SysInfoTextBox5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.SysInfoTextBox5.Cursor = System.Windows.Forms.Cursors.Arrow
Me.SysInfoTextBox5.Location = New System.Drawing.Point(145, 68)
Me.SysInfoTextBox5.Name = "SysInfoTextBox5"
Me.SysInfoTextBox5.ReadOnly = True
Me.SysInfoTextBox5.Size = New System.Drawing.Size(277, 20)
Me.SysInfoTextBox5.TabIndex = 9
'
'SysInfoLabel5
'
Me.SysInfoLabel5.AutoSize = True
Me.SysInfoLabel5.Location = New System.Drawing.Point(7, 75)
Me.SysInfoLabel5.Name = "SysInfoLabel5"
Me.SysInfoLabel5.Size = New System.Drawing.Size(122, 13)
Me.SysInfoLabel5.TabIndex = 8
Me.SysInfoLabel5.Text = "ShiftOS Computer Name"
'
'SysInfoBox2 'SysInfoBox2
' '
Me.SysInfoBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.SysInfoBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
@ -135,6 +155,7 @@ Partial Class systeminfo
' '
'GroupBox1 'GroupBox1
' '
Me.GroupBox1.Controls.Add(Me.Button1)
Me.GroupBox1.Controls.Add(Me.SysInfoLabel3) Me.GroupBox1.Controls.Add(Me.SysInfoLabel3)
Me.GroupBox1.Controls.Add(Me.SysInfoBox3) Me.GroupBox1.Controls.Add(Me.SysInfoBox3)
Me.GroupBox1.Controls.Add(Me.SysInfoBox4) Me.GroupBox1.Controls.Add(Me.SysInfoBox4)
@ -159,20 +180,20 @@ Partial Class systeminfo
' '
Me.SysInfoBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.SysInfoBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.SysInfoBox3.Cursor = System.Windows.Forms.Cursors.Arrow Me.SysInfoBox3.Cursor = System.Windows.Forms.Cursors.Arrow
Me.SysInfoBox3.Location = New System.Drawing.Point(124, 15) Me.SysInfoBox3.Location = New System.Drawing.Point(68, 15)
Me.SysInfoBox3.Name = "SysInfoBox3" Me.SysInfoBox3.Name = "SysInfoBox3"
Me.SysInfoBox3.ReadOnly = True Me.SysInfoBox3.ReadOnly = True
Me.SysInfoBox3.Size = New System.Drawing.Size(277, 20) Me.SysInfoBox3.Size = New System.Drawing.Size(220, 20)
Me.SysInfoBox3.TabIndex = 8 Me.SysInfoBox3.TabIndex = 8
' '
'SysInfoBox4 'SysInfoBox4
' '
Me.SysInfoBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.SysInfoBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.SysInfoBox4.Cursor = System.Windows.Forms.Cursors.Arrow Me.SysInfoBox4.Cursor = System.Windows.Forms.Cursors.Arrow
Me.SysInfoBox4.Location = New System.Drawing.Point(124, 46) Me.SysInfoBox4.Location = New System.Drawing.Point(68, 48)
Me.SysInfoBox4.Name = "SysInfoBox4" Me.SysInfoBox4.Name = "SysInfoBox4"
Me.SysInfoBox4.ReadOnly = True Me.SysInfoBox4.ReadOnly = True
Me.SysInfoBox4.Size = New System.Drawing.Size(277, 20) Me.SysInfoBox4.Size = New System.Drawing.Size(220, 20)
Me.SysInfoBox4.TabIndex = 9 Me.SysInfoBox4.TabIndex = 9
' '
'SysInfoLabel4 'SysInfoLabel4
@ -316,26 +337,17 @@ Partial Class systeminfo
Me.titlebar.Size = New System.Drawing.Size(442, 30) Me.titlebar.Size = New System.Drawing.Size(442, 30)
Me.titlebar.TabIndex = 19 Me.titlebar.TabIndex = 19
' '
'SysInfoLabel5 'Button1
' '
Me.SysInfoLabel5.AutoSize = True Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.SysInfoLabel5.Location = New System.Drawing.Point(7, 75) Me.Button1.Location = New System.Drawing.Point(294, 15)
Me.SysInfoLabel5.Name = "SysInfoLabel5" Me.Button1.Name = "Button1"
Me.SysInfoLabel5.Size = New System.Drawing.Size(122, 13) Me.Button1.Size = New System.Drawing.Size(122, 55)
Me.SysInfoLabel5.TabIndex = 8 Me.Button1.TabIndex = 10
Me.SysInfoLabel5.Text = "ShiftOS Computer Name" Me.Button1.Text = "Dump to Text File"
Me.Button1.UseVisualStyleBackColor = True
' '
'SysInfoTextBox5 'systeminfo
'
Me.SysInfoTextBox5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.SysInfoTextBox5.Cursor = System.Windows.Forms.Cursors.Arrow
Me.SysInfoTextBox5.Location = New System.Drawing.Point(145, 68)
Me.SysInfoTextBox5.Name = "SysInfoTextBox5"
Me.SysInfoTextBox5.ReadOnly = True
Me.SysInfoTextBox5.Size = New System.Drawing.Size(277, 20)
Me.SysInfoTextBox5.TabIndex = 9
'
'SystemInfo
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
@ -346,7 +358,7 @@ Partial Class systeminfo
Me.Controls.Add(Me.pgleft) Me.Controls.Add(Me.pgleft)
Me.Controls.Add(Me.titlebar) Me.Controls.Add(Me.titlebar)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "SystemInfo" Me.Name = "systeminfo"
Me.Text = "SystemInfo" Me.Text = "SystemInfo"
Me.TopMost = True Me.TopMost = True
Me.pgcontents.ResumeLayout(False) Me.pgcontents.ResumeLayout(False)
@ -391,4 +403,5 @@ Partial Class systeminfo
Friend WithEvents titlebar As System.Windows.Forms.Panel Friend WithEvents titlebar As System.Windows.Forms.Panel
Friend WithEvents SysInfoTextBox5 As System.Windows.Forms.TextBox Friend WithEvents SysInfoTextBox5 As System.Windows.Forms.TextBox
Friend WithEvents SysInfoLabel5 As System.Windows.Forms.Label Friend WithEvents SysInfoLabel5 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
End Class End Class

View file

@ -443,4 +443,8 @@
SysInfoBox4.Text = (String.Format("{0} Megabytes", System.Math.Round(My.Computer.Info.TotalPhysicalMemory / (1024 * 1024)), 2).ToString) SysInfoBox4.Text = (String.Format("{0} Megabytes", System.Math.Round(My.Computer.Info.TotalPhysicalMemory / (1024 * 1024)), 2).ToString)
End Sub End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
File_Saver.savingprogram = "sysinf"
File_Saver.Show()
End Sub
End Class End Class