Okay Guys, I have asked many questions here and would like to take a moment to contribute back to the forum now!
Some pro's here might think this was coded poorly, but it works :D
What the form would look like:
![[Image: rWcXCb8.png]](https://i.imgur.com/rWcXCb8.png)
1: When the program is launched you must create folders and txt's for your program.
2: Add the settings or inputs for the campaign and the listview
![[Image: rWcXCb8.png]](https://i.imgur.com/rWcXCb8.png)
4: Make it add and save
what this will do is create a campaign if one of that name does not already exist. If it doesn't then it will create a folder containing the settings of the campaign. This is so later in the program the folder can hold other stuff for that campaign like another txt with proxies or whatnot ;)
5: Make it load the list of campaigns
NOTE- I added this many places throughout the code of my program but I will show you one place to make it simple to understand
This is that little refresh picture on the bottom right of the listview ;)
6: Now to let the user Edit the campaign.
You can do double click or selected index changed for this part, I chose index changed because it is faster for me when testing xD
Then The edit button itself:
Now with this made the user can select their campaigns through a dropdown as such:
![[Image: w58rUGT.png]](https://i.imgur.com/w58rUGT.png)
This is where my code gets really sketchy...
I say that it is sketchy because if there are alot of campaigns it takes a little while to load the campaigns so you might need to work on that part. But for the purpose of the code I think I did pretty well on this 👍
I hope this helps some of you and if you have any questions feel free to ask!
Here are a couple pictures of it:
![[Image: pwXrjM8.png]](https://i.imgur.com/pwXrjM8.png)
![[Image: gaFJGg6.png]](https://i.imgur.com/gaFJGg6.png)
![[Image: yAhbsBG.png]](https://i.imgur.com/yAhbsBG.png)
Some pro's here might think this was coded poorly, but it works :D
What the form would look like:
![[Image: rWcXCb8.png]](https://i.imgur.com/rWcXCb8.png)
1: When the program is launched you must create folders and txt's for your program.
Code
If (Not System.IO.Directory.Exists("C:\pasteboy")) Then
System.IO.Directory.CreateDirectory("C:\pasteboy")
End If
HurrycanProgressBar1.Increment(34)
If (Not System.IO.Directory.Exists("C:\pasteboy\campaigns")) Then
System.IO.Directory.CreateDirectory("C:\pasteboy\campaigns")
End If
HurrycanProgressBar1.Increment(34)
If Not System.IO.File.Exists("C:\pasteboy\settings.txt") Then
System.IO.File.Create("C:\pasteboy\settings.txt").Dispose()
End If
HurrycanProgressBar1.Increment(32)2: Add the settings or inputs for the campaign and the listview
![[Image: rWcXCb8.png]](https://i.imgur.com/rWcXCb8.png)
4: Make it add and save
Code
Private Sub HurrycanButton2_Click(sender As Object, e As EventArgs) Handles HurrycanButton2.Click
Dim Campaign As New ListViewItem(txtbxName.Text) 'Name
Campaign.SubItems.Add(txtbxKW.Text) 'KW
Dim type As String
If rndmChk.Checked = True Then
type = "Random"
Else
type = pastetypeCombo.Text
End If
Campaign.SubItems.Add(type) 'Type
Dim expire As String
If expirerndmchk.Checked = True Then
expire = "Random"
Else
expire = expireCombo.Text
End If
Campaign.SubItems.Add(expire)
ListView1.Items.Add(Campaign)
If (Not System.IO.Directory.Exists("C:\pasteboy\campaigns\" & txtbxName.Text)) Then
System.IO.Directory.CreateDirectory("C:\pasteboy\campaigns\" & txtbxName.Text)
Else
MsgBox("Error: Campaign Name Allready Exists!")
End If
If Not System.IO.File.Exists("C:\pasteboy\campaigns\" & txtbxName.Text & "\settings.txt") Then
System.IO.File.Create("C:\pasteboy\campaigns\" & txtbxName.Text & "\settings.txt").Dispose()
Dim file As System.IO.StreamWriter
file = My.Computer.FileSystem.OpenTextFileWriter("C:\pasteboy\campaigns\" & txtbxName.Text & "\settings.txt", True)
file.Write(txtbxName.Text & ":" & txtbxKW.Text & ":" & type & ":" & expire)
file.Close()
Else
MsgBox("Error: Campaign Name Already Exists!")
End If
ListView1.Items.Clear()
Try
Dim Dirs() As String = Directory.GetDirectories("C:\pasteboy\campaigns")
For Each Dir As String In Dirs
GetCampaign(Dir)
Next
Catch ex As Exception
End Try
End Subwhat this will do is create a campaign if one of that name does not already exist. If it doesn't then it will create a folder containing the settings of the campaign. This is so later in the program the folder can hold other stuff for that campaign like another txt with proxies or whatnot ;)
5: Make it load the list of campaigns
NOTE- I added this many places throughout the code of my program but I will show you one place to make it simple to understand
This is that little refresh picture on the bottom right of the listview ;)
Code
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
ListView1.Items.Clear()
Try
Dim Dirs() As String = Directory.GetDirectories("C:\pasteboy\campaigns")
For Each Dir As String In Dirs
GetCampaign(Dir)
Next
Catch ex As Exception
End Try
End Sub6: Now to let the user Edit the campaign.
You can do double click or selected index changed for this part, I chose index changed because it is faster for me when testing xD
Code
Private Sub ListView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListView1.SelectedIndexChanged
txtbxName.Enabled = False
txtbxName.Text = ListView1.FocusedItem.SubItems(0).Text
txtbxKW.Text = ListView1.FocusedItem.SubItems(1).Text
If ListView1.FocusedItem.SubItems(2).Text = "Random" Then
rndmChk.Checked = True
expireCombo.Text = ""
Else
rndmChk.Checked = False
pastetypeCombo.Text = ListView1.FocusedItem.SubItems(2).Text
End If
If ListView1.FocusedItem.SubItems(3).Text = "Random" Then
expirerndmchk.Checked = True
expireCombo.Text = ""
Else
expirerndmchk.Checked = False
expireCombo.Text = ListView1.FocusedItem.SubItems(3).Text
End If
End SubThen The edit button itself:
Code
ListView1.Clear()
Dim Campaign As New ListViewItem(txtbxName.Text) 'Name
Campaign.SubItems.Add(txtbxKW.Text) 'KW
Dim type As String
If rndmChk.Checked = True Then
type = "Random"
Else
type = pastetypeCombo.Text
End If
Campaign.SubItems.Add(type) 'Type
Dim expire As String
If expirerndmchk.Checked = True Then
expire = "Random"
Else
expire = expireCombo.Text
End If
Campaign.SubItems.Add(expire)
System.IO.File.Delete("C:\pasteboy\campaigns\" & txtbxName.Text & "\settings.txt")
System.IO.File.Create("C:\pasteboy\campaigns\" & txtbxName.Text & "\settings.txt").Dispose()
Dim file As System.IO.StreamWriter
file = My.Computer.FileSystem.OpenTextFileWriter("C:\pasteboy\campaigns\" & txtbxName.Text & "\settings.txt", True)
file.Write(txtbxName.Text & ":" & txtbxKW.Text & ":" & type & ":" & expire)
file.Close()
ListView1.Items.Clear()
Try
Dim Dirs() As String = Directory.GetDirectories("C:\pasteboy\campaigns")
For Each Dir As String In Dirs
GetCampaign(Dir)
Next
Catch ex As Exception
End TryNow with this made the user can select their campaigns through a dropdown as such:
![[Image: w58rUGT.png]](https://i.imgur.com/w58rUGT.png)
This is where my code gets really sketchy...
Code
HurrycanComboBox2.Items.Clear()
Try
Dim Dirs() As String = Directory.GetDirectories("C:\pasteboy\campaigns")
For Each Dir As String In Dirs
HurrycanComboBox2.Items.Add(Dir.Replace("C:\pasteboy\campaigns\", ""))
Next
Catch ex As Exception
End TryI say that it is sketchy because if there are alot of campaigns it takes a little while to load the campaigns so you might need to work on that part. But for the purpose of the code I think I did pretty well on this 👍
I hope this helps some of you and if you have any questions feel free to ask!
Here are a couple pictures of it:
![[Image: pwXrjM8.png]](https://i.imgur.com/pwXrjM8.png)
![[Image: gaFJGg6.png]](https://i.imgur.com/gaFJGg6.png)
![[Image: yAhbsBG.png]](https://i.imgur.com/yAhbsBG.png)

