使用更多ram和轨迹栏启动程序

时间:2013-09-25 18:06:16

标签: vb.net variables ram trackbar

所以我正在制作一个程序,我有一个轨迹栏,向上或向下移动可以改变特定程序开始的RAM量。除此之外不起作用。

项目加载时:

Dim VRAM As String
    Select VRAMT.Value
        Case 1
            VRAM = 256
            TextBox4.Text = VRAM
        Case 2
            VRAM = 512
            TextBox4.Text = VRAM
        Case 3
            VRAM = 768
            TextBox4.Text = VRAM
        Case 4
            VRAM = 1024
            TextBox4.Text = VRAM
        Case 5
            VRAM = 1280
            TextBox4.Text = VRAM
        Case 6
            VRAM = 1636
            TextBox4.Text = VRAM
        Case 7
            VRAM = 1792
            TextBox4.Text = VRAM
        Case 8
            VRAM = 2048

单击启动程序的按钮时

Process.Start("C:\ServerMaker\Vanilla\VanillaServer.exe", "/C java -Xmx""VRAM""M -Xms""VRAM""M -exe VanillaServer.exe")

要用2gb ram启动它,它将是

Process.Start("C:\ServerMaker\Vanilla\VanillaServer.exe", "/C java -Xmx"2048"M -Xms"2048"M -exe VanillaServer.exe")

由于

1 个答案:

答案 0 :(得分:0)

Plutonix已有答案,但请更改您的选择...

Dim VRAM As String = (VRAMT.Value * 256).toString()
TextBox4.Text = VRAM