这段代码谁能帮忙转换成asp环境下可以运行的vb代码
也就是要改成可以放进asp文件运行的代码。代码如下privatevoidbutton4_Click(objectsender,EventArgse){stringline...
也就是要改成可以放进asp文件运行的代码。代码如下
private void button4_Click(object sender, EventArgs e)
{
string line;
string[] str1;
string n2;
openFileDialog1.Filter = "文本文件(*.txt)|*.txt";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
StreamReader sr =
new StreamReader(openFileDialog1.FileName, Encoding.GetEncoding("GB2312"));
while ((line = sr.ReadLine()) != null)
{
if (!line.Equals(string.Empty))
{
str1 = line.Trim().Split('【');
if (str1.Length < 2)
{
//textBox2.Text += str1[0].ToString();
}
else
{
//n1 = str1[0];
n2 = str1[1];
str1 = n2.Split('】');
n2 = str1[0];
//n3 = str1[1];
if (n2.Length == 2)
{
textBox2.Text += n2;
textBox2.Text += "\r\n";
}
//textBox2.Text += n1 + " " + n2 + ":" + n3;
//textBox2.Text += "\r\n";
}
}
}
}
} 展开
private void button4_Click(object sender, EventArgs e)
{
string line;
string[] str1;
string n2;
openFileDialog1.Filter = "文本文件(*.txt)|*.txt";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
StreamReader sr =
new StreamReader(openFileDialog1.FileName, Encoding.GetEncoding("GB2312"));
while ((line = sr.ReadLine()) != null)
{
if (!line.Equals(string.Empty))
{
str1 = line.Trim().Split('【');
if (str1.Length < 2)
{
//textBox2.Text += str1[0].ToString();
}
else
{
//n1 = str1[0];
n2 = str1[1];
str1 = n2.Split('】');
n2 = str1[0];
//n3 = str1[1];
if (n2.Length == 2)
{
textBox2.Text += n2;
textBox2.Text += "\r\n";
}
//textBox2.Text += n1 + " " + n2 + ":" + n3;
//textBox2.Text += "\r\n";
}
}
}
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询