BlackHat Posted June 15, 2020 Posted June 15, 2020 (edited) I have One textBox and a Button1 Code of btnStart if (this.txtBox.Text.Length == 0) { Interaction.MsgBox("Please Insert Your Data", MsgBoxStyle.OkOnly, null); return; } this.thflag = false; this.th2flag = false; this.btnstart.Enabled = false; this.btnstop.Enabled = true; this.th = new Thread(new ThreadStart(this.BlackHat)); this.th.IsBackground = true; this.th.Start(); this.Timer1.Enabled = true; This is my code of this.BlackHat checked { using (WebClient webClient = new WebClient()) { foreach (string text in this.txtBox.Lines) { if (!string.IsNullOrEmpty(text)) { string address = "https://XXXXXXX/" + text + "XXXXXXXXXXX"; for (;;) So What is My Problem ? When I paste my Data into textBox like this text1 text2 text3 text4...... text100 So My code sent request One by One means First it get "text1" then once this query executed it move to "text2" and then to "text3" I want it to make like this that When I press Button "Start" It reads 50 Text at once. means + text + this Code in the URL give input like text1,text2,text3.......text50 in one request and after this text51,text52,text43.....text100 in 2nd Query. For Example, I put text1 text2 text3... text100 in the textbox So now my URL is like this -- "https://XXXXXXX/" + text1 + "XXXXXXXXXXX"; after this "https://XXXXXXX/" + text2 + "XXXXXXXXXXX"; and after this "https://XXXXXXX/" + text3 + "XXXXXXXXXXX"; and so on ... I want it that It reads Data ;like this "https://XXXXXXX/" + text1,text2,text3,text4......text50 + "XXXXXXXXXXX"; "https://XXXXXXX/" + text51,text52,text53,text54......text100 + "XXXXXXXXXXX"; and so on So Please guide me What Changes I need to do or How I can do this. Edited June 15, 2020 by BlackHat
Derberux Posted June 15, 2020 Posted June 15, 2020 https://docs.microsoft.com/en-us/dotnet/api/system.string.concat Get the next 50 elements and concat them, then repeat. If you want to add a delimiter for every text use Join instead. https://docs.microsoft.com/en-us/dotnet/api/system.string.join?view=netcore-3.1#System_String_Join_System_String_System_String___ You should consider taking a programming course. 1 1
BlackHat Posted November 2, 2020 Author Posted November 2, 2020 Resolved It using string builder !!! Afterall
BlackHat Posted November 2, 2020 Author Posted November 2, 2020 39 minutes ago, whoknows said: try this WindowsFormsApplication40.rar 9.34 kB · 2 downloads Awesome A Big Thanks !!!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now