Доброго времени суток.
Пришёл к вам за помощью ) Дело срочное а времени на то чтобы всё выучить нету ( . Суть проблеммы такова как сделать так чтобы у программы был конфиг .
Вот код
Public Class Form1
Dim ConnectServerIP As String = "78.26.178.61"
Dim ConnectServerPORT As String = "44405"
Dim Main As String = "Main.exe"
Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dwExtraInfo As Long)
Private Const mouseclickup = 4
Private Const mouseclickdownl = 2
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.NumPad0 Then
Timer1.Start()
End If
If e.KeyCode = Keys.NumPad1 Then
Timer1.Stop()
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ToolStripTextBox1.Text = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "ID", "GameWorld")
Try
Dim ts As System.Net.Sockets.TcpClient = New System.Net.Sockets.TcpClient(ConnectServerIP, ConnectServerPORT)
Catch ex As System.Net.Sockets.SocketException
If (ex.ErrorCode = 10061) Then
ToolStripStatusLabel2.Text = "Не работает"
End If
End Try
End Sub
Private Sub ToolStripTextBox1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripTextBox1.MouseLeave
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "ID", ToolStripTextBox1.Text)
End Sub
Private Sub X600ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles X600ToolStripMenuItem.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "Resolution", 1)
End Sub
Private Sub X768ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles X768ToolStripMenuItem.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "Resolution", 2)
End Sub
Private Sub X1024ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles X1024ToolStripMenuItem.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "Resolution", 3)
End Sub
Private Sub BitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BitToolStripMenuItem.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "ColorDepth", 0)
End Sub
Private Sub BitToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BitToolStripMenuItem1.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "ColorDepth", 1)
End Sub
Private Sub OnToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OnToolStripMenuItem.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "SoundOnOff", 1)
End Sub
Private Sub OffToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OffToolStripMenuItem.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "SoundOnOff", 0)
End Sub
Private Sub OnToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OnToolStripMenuItem1.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "MusicOnOff", 1)
End Sub
Private Sub OffToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OffToolStripMenuItem1.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "MusicOnOff", 0)
End Sub
Private Sub OnToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OnToolStripMenuItem2.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "WindowMode", 1)
End Sub
Private Sub OffToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OffToolStripMenuItem2.Click
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Webzen\Mu\Config", "WindowMode", 0)
End Sub
Private Sub StartToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartToolStripMenuItem.Click
If My.Computer.FileSystem.FileExists(Main) Then
Dim p As Process = Process.Start(Main)
Else
MsgBox("Can't locate 'main.exe', please reinstall client!", MsgBoxStyle.OkOnly, "GameWorld Client Error")
End If
End Sub
Private Sub UpdateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateToolStripMenuItem.Click
WebBrowser1.Navigate("http://gameworld.net.ua/gw/update/update.php")
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
mouse_event(mouseclickdownl, 0, 0, 0, 0)
mouse_event(mouseclickup, 0, 0, 0, 0)
End Sub
Private Sub CloseLauncherToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseLauncherToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
About.Show()
End Sub
Private Sub BugReportToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BugReportToolStripMenuItem.Click
WebBrowser1.Navigate("http://gameworld.net.ua/gw/forum/")
End Sub
Private Sub GuideToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GuideToolStripMenuItem.Click
Guide.Show()
End Sub
Private Sub VoteForUsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VoteForUsToolStripMenuItem.Click
WebBrowser1.Navigate("http://game100rus.com/index.php?do=votes&id=7188")
End Sub
Private Sub OptionsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Settings.Show()
End Sub
Private Sub ToolStripTextBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripTextBox1.Click
End Sub
Private Sub SettingsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Settings.Show()
End Sub
Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click
End Sub
End Class
Содержимое CoderZ.ini
MuConnectIp=78.26.178.61
MuConnectPort=44405
MuExe=Main.exe
MuWeb=http://gameworld.net.ua/gw/index.php
MuWebForum=http://gameworld.net.ua/gw/forum/
MuWebVote=http://game100rus.com/index.php?do=votes&id=7188
MuWebUpdate=http://gameworld.net.ua/gw/update/update.php
Заранее спасибббооооооо)
Ответить
|