Jump to content
Tuts 4 You

Needing a Very Small Help in C# PLEASE !!


BlackHat

Recommended Posts

BlackHat

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 by BlackHat (see edit history)
Link to post
Derberux

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.

 

  • Like 1
  • Thanks 1
Link to post
  • 4 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...