TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jmal salih
NA
8
7.5k
for loop
May 14 2014 4:14 AM
this code work only on number from 1 to 10 repeated 3 times for example
with other numbers do nothing here is my code:
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text==""||textBox1.Text=="")
{
MessageBox.Show("enter the numbers");
}
else
{
string file = @"c:\\test.txt";
try
{
// Check if file already exists. If yes, delete it.
if (File.Exists(file))
{
File.Delete(file);
}
int x = Int32.Parse(textBox1.Text);
int y = Int32.Parse(textBox2.Text);
int count = Int32.Parse(textBox3.Text);
System.IO.StreamWriter sw = new System.IO.StreamWriter(file);
for (int i = x; i <= count; i++)
for (int j = x; j <= y; j++)
{
sw.WriteLine(i);
}
sw.Close();
}
catch (Exception Ex)
{
MessageBox.Show(Ex.ToString());
}
}
}
Reply
Answers (
1
)
disable the controls in panel
how to read a barcode using barcode reader in c#