![]() |
|
[VB.Net] Make your own Fake error Builder - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: [VB.Net] Make your own Fake error Builder (/Thread-VB-Net-Make-your-own-Fake-error-Builder) |
[VB.Net] Make your own Fake error Builder - 1234hotmaster - 02-03-2011 Step 1: Start a new project and name it Builder. Start another project and name it stub. Step 2: Go in the builder project and add 4 radio buttons, 2 buttons and 2 textboxes making the second one multilines, the first button named "Test" and the second "Build". radiobutton1's text to "Critical" radiobutton2's text to "Information" radiobutton3's text to "YesNo" and radiobutton4's text to "exclamation". Step 3: Double click the "Test button and add this code: Code: if radiobutton1.checked = true then
msgbox(textbox2.text, msgboxstyle.critical, textbox1.text)
elseif radiobutton2.checked = true then
msgbox(textbox2.text, msgboxstyle.information, textbox1.text)
elseif radiobutton3.checked = true then
msgbox(textbox2.text, msgboxstyle.yesno, textbox1.text)
elseif radiobutton4.checked = true then
msgbox(textbox2.text, msgboxstyle.exclamation , textbox1.text)
end ifStep 4: Change the names of the components to these ones in front of them in the designer: RadioButton1.Name = "critical" RadioButton2.Name = "information" RadioButton3.Name = "yesno" RadioButton4.Name = "exclamation" textbox1.name = "msgtitle" textbox2.name = "msgbody" Step 5: Double click the build button and add this: Code: io.file.copy(CurDir() & "\stub.exe", curdir & "\server.exe")
io.file.appendalltext( curdir & "\server.exe", "FileSpilt" & msgbody.text & "FileSpilt" & msgtitle.text & "FileSpilt" & critical.checked & "FileSpilt" & information.checked & "FileSpilt" & yesno.checked & "FileSpilt" & exclamation.checked )
MsgBox("Built!", msgboxstyle.Information)
process.start(curdir)Step 6: Go in the stub and add this code to the form's load: Code: Me.Height = 0
Me.Width = 0
Me.Opacity = 0
Me.Hide()
Me.Visible = False
Me.ShowInTaskbar = False
Me.ShowIcon = False
Dim msgtitle, msgbody As String
Dim Critical, information, yesno, exclamation As Boolean
Dim BinText As String = IO.File.ReadAllText(Application.ExecutablePath)
If BinText.Contains("FileSpilt") = False Then Exit Sub
Dim ArrContents() As String = Split(BinText, "FileSpilt")
msgtitle = ArrContents(1)
msgbody = ArrContents(2)
Critical = ArrContents(3)
information = ArrContents(4)
yesno = ArrContents(5)
exclamation = ArrContents(6)
If Critical = True Then
MsgBox(msgbody, MsgBoxStyle.Critical, msgtitle)
ElseIf information = True Then
MsgBox(msgbody, MsgBoxStyle.Information, msgtitle)
ElseIf yesno = True Then
MsgBox(msgbody, MsgBoxStyle.YesNo, msgtitle)
ElseIf exclamation = True Then
MsgBox(msgbody, MsgBoxStyle.Exclamation, msgtitle)
End If
Me.Close()
Catch ex As Exception
End Try
End SubStep 7: The designer of the builder should look like something like this: Step 8: Its ready to use! congratz you made your own fake error generator :thumbs: RE: [VB.Net] Make your own Fake error Builder - Coder-san - 02-03-2011 Good tutorial. You can choose any unique text for Filesplit.
RE: [VB.Net] Make your own Fake error Builder - 1234hotmaster - 02-03-2011 tnx and yea. btw can you post the way you said its better to spilt text? o,o RE: [VB.Net] Make your own Fake error Builder - Rocky_mybb_import5958 - 02-03-2011 excelent share thanks RE: [VB.Net] Make your own Fake error Builder - Coder-san - 02-03-2011 (02-03-2011, 07:59 AM)1234hotmaster Wrote: tnx and yea. btw can you post the way you said its better to spilt text? o,o If you are talking about String-replacement, then I can't make it happen in VB.Net apps. You need Nathan's Byte-replacement for VB.Net (which is my method based on), as VB.Net removes spaces on compiling, makes it hard to read from the app directly. It's easier in VB6. RE: [VB.Net] Make your own Fake error Builder - ShawnReynolds - 06-28-2014 1234hotmaster, I am currently trying to make a program using the tutorial you provided. It seems to be a good tutorial, but I am getting confused. Do you think you could post some screenshots of you making the program? I think that would help me.[/size][size=x-small] |