Well, thanks to you guys i got my first program up and running, but i want to make a few changes... First of all... I want the program to load previously saved options... so When you save the 4 checkboxes and re-open the program... the most recent ones are still marked... Second.. Not all people have there .ini file always in the C:\Program Files\Silkroad\ So if there is a way to change that so people can select there silkroad directory that would be awesome as well. and i think thats it for now... anyway, heres the code.
Heres the project if you want it...Code:Public Class Form1 Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyName As String, ByVal lsString As String, ByVal lplFilename As String) As Integer Sub SaveINISetting(ByVal Filename As String, ByVal Key As String, ByVal Setting As String, ByVal Value As Object) WritePrivateProfileString(Key, Setting, Value, Filename) End Sub Private Sub save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save.Click SaveINISetting("C:\Program Files\Silkroad\C19H28O2.ini", "Options", "Zoomhack", zoom.CheckState) SaveINISetting("C:\Program Files\Silkroad\C19H28O2.ini", "Options", "NudePatch", nude.CheckState) SaveINISetting("C:\Program Files\Silkroad\C19H28O2.ini", "Options", "NoDC", disc.CheckState) SaveINISetting("C:\Program Files\Silkroad\C19H28O2.ini", "Options", "ChatFilter", chat.CheckState) MsgBox("Config successfully saved!") End Sub Private Sub launch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles launch.Click Dim ofd As New OpenFileDialog ofd.Filter = "EXE File (*.exe)|*.exe" ofd.Title = "Select Loader.exe" ofd.ShowDialog() If ofd.FileName <> "" Then Process.Start(ofd.FileName) Else 'User cancelled the dialog End If End Sub Private Sub leave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles leave.Click Me.Close() End Sub Private Sub link_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles link.LinkClicked Process.Start("http://www.7knights.co.nr") End Sub Private Sub info_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles info.Click MsgBox("Point your browser to C19H28O2's Loader.exe V-2.0") End Sub End Class
http://rapidshare.com/files/79548144/7K_Launcher.rar




Reply With Quote