Advertisement
Guest User

Untitled

a guest
Aug 17th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.32 KB | None | 0 0
  1. Public Class Form1
  2. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  3. ComboBox1.Items.Add("low graphics")
  4. ComboBox1.Items.Add("medium graphics")
  5. ComboBox1.Items.Add("max graphics")
  6. If My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec rec.cfg") And My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec bad.cfg") Then
  7. Label2.Text = "Current cfg: medium graphics"
  8. ElseIf My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec mid.cfg") And My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec bad.cfg") Then
  9. Label2.Text = "Current cfg: max graphics"
  10. ElseIf My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec mid.cfg") And My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec rec.cfg") Then
  11. Label2.Text = "Current cfg: low graphics"
  12. Else
  13. Label2.Text = "Current cfg: none"
  14. End If
  15. End Sub
  16. Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
  17.  
  18. End Sub
  19. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  20. If ComboBox1.Text = "" Then
  21. MsgBox("Please choose a graphics config to install")
  22. Else
  23. If ComboBox1.Text = "low graphics" Then
  24. If Label2.Text = "Current cfg: medium graphics" Then
  25. If My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec bad.cfg") Then
  26. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec.cfg", "autoexec mid.cfg")
  27. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec bad.cfg", "autoexec.cfg")
  28. End If
  29. ElseIf Label2.Text = "Current cfg: max graphics" Then
  30. If My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec bad.cfg") Then
  31. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec.cfg", "autoexec rec.cfg")
  32. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec bad.cfg", "autoexec.cfg")
  33. End If
  34. End If
  35. Label2.Text = "Current cfg: low graphics"
  36. ElseIf ComboBox1.Text = "medium graphics" Then
  37. If Label2.Text = "Current cfg: low graphics" Then
  38. If My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec mid.cfg") Then
  39. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec.cfg", "autoexec bad.cfg")
  40. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec mid.cfg", "autoexec.cfg")
  41. End If
  42. ElseIf Label2.Text = "Current cfg: max graphics" Then
  43. If My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec mid.cfg") Then
  44. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec.cfg", "autoexec rec.cfg")
  45. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec mid.cfg", "autoexec.cfg")
  46. End If
  47. End If
  48. Label2.Text = "Current cfg: medium graphics"
  49. ElseIf ComboBox1.Text = "max graphics" Then
  50. If Label2.Text = "Current cfg: low graphics" Then
  51. If My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec rec.cfg") Then
  52. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec.cfg", "autoexec bad.cfg")
  53. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec rec.cfg", "autoexec.cfg")
  54. End If
  55. ElseIf Label2.Text = "Current cfg: medium graphics" Then
  56. If My.Computer.FileSystem.FileExists("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec rec.cfg") Then
  57. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec.cfg", "autoexec mid.cfg")
  58. My.Computer.FileSystem.RenameFile("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg\autoexec rec.cfg", "autoexec.cfg")
  59. End If
  60. End If
  61. Label2.Text = "Current cfg: max graphics"
  62. End If
  63. MsgBox(ComboBox1.Text & " cfg set!")
  64. End If
  65. End Sub
  66.  
  67. Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
  68. Process.Start("F:\Steam\SteamApps\common\Team Fortress 2\tf\cfg")
  69. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement