protected void generatetickerxml_update()
{
try
{
if (combo_rss.SelectedItem.ToString() != "-SELECT RSS-")
{
string path = Readxml();
if (File.Exists(path + "\\oohmp\\xml\\" + combo_rss.SelectedItem.ToString() + ".xml"))
{
str = new StringBuilder();
int i;
string rssinterval = Convert.ToString(Convert.ToInt16(combo_rssinterval.SelectedItem.ToString()) * 1000);
string checkagain = Convert.ToString(Convert.ToInt16(combo_checkagain.SelectedItem.ToString()) * 1000);
//string str_flag = combo_rss.SelectedItem.ToString();
//if (str_flag == "bot")
//{
// str_flag = "bottom";
//}
string col = txt_forecolorhexanumber.Text.Trim();
string color = col.Replace("#", "");
string[] forecolor = color.Split(':');
string col1 = txt_bghexanumber.Text.Trim();
string color1 = col1.Replace("#", "");
string[] bgcolor = color1.Split(':');
for (i = 0; i < dataGridView3.Rows.Count; i++)
{
string strt = dataGridView3.Rows[i].Cells["title"].Value.ToString();
if (strt != "")
{
if (str.Length == 0)
{
" Error Line" str.Append(String.Format("
str.Append(String.Format("{0}\t
}
else
{
str.Append(String.Format("{0}\t\t
}
}
}
//if (str_flag == "bottom")
//{
// str_flag = "bot";
//}
if (str.Length != 0)
{
str.Append(String.Format("{0}\t
File.WriteAllText(path + "\\oohmp\\xml\\" + combo_rss.SelectedItem.ToString() + ".xml", str.ToString());
File.WriteAllText(path + "\\oohmp\\box\\" + combo_rss.SelectedItem.ToString() + ".xml", str.ToString());
//MessageBox.Show("Ticker text is saved", "Message");
}
Bindticker();
}
else
{
str = new StringBuilder();
int row = dataGridView3.Rows.Count;
string rssinterval = Convert.ToString(Convert.ToInt16(combo_rssinterval.SelectedItem.ToString()) * 1000);
string checkagain = Convert.ToString(Convert.ToInt16(combo_checkagain.SelectedItem.ToString()) * 1000);
string str_flag = combo_rss.SelectedItem.ToString();
//if (str_flag == "bot")
//{
// str_flag = "bottom";
//}
string col = txt_forecolorhexanumber.ToString().Trim();
string color = col.Replace("#", "");
string[] forecolor = color.Split(':');
string col1 = txt_bghexanumber.ToString().Trim();
string color1 = col1.Replace("#", "");
string[] bgcolor = color1.Split(':');
for (int j = 0; j < row; j++)
{
string strt = dataGridView3.Rows[j].Cells["title"].Value.ToString();
if (strt != "")
{
if (str.Length == 0)
{
str.Append(String.Format("
str.Append(String.Format("{0}\t
}
else
{
str.Append(String.Format("{0}\t\t
}
}
}
//if (str_flag == "bottom")
//{
// str_flag = "bot";
//}
if (str.Length != 0)
{
str.Append(String.Format("{0}\t
File.WriteAllText(path + "\\oohmp\\xml\\" + combo_rss.SelectedItem.ToString() + ".xml", str.ToString());
File.WriteAllText(path + "\\oohmp\\box\\" + combo_rss.SelectedItem.ToString() + ".xml", str.ToString());
//MessageBox.Show("Ticker text is saved", "Message");
}
else
{
MessageBox.Show("Ticker Text Is Blank", "Error");
}
Bindticker();
}
}
else
{
MessageBox.Show("Please Select rss type.", "Message");
}
}
catch (Exception ex)
{
MessageBox.Show("Error Occured.", "Error");
}
}

EhteshamPosted May 24, 2012, 2:25 AM
for instance
String[] array=new String[10];
array[11]="Some String";
the above causes "index out of range" as allocated max index size is 9 but trying to assign a value at index 11