C#真难用,下面的东东死活转不过来。Dim a As Integer = InStr(str1, "<td width=""40"">天气</td>")
a = a - 5 Dim b As Integer = InStr(str1, "<td>风力</td>")
b = b - 65 Dim gs As Integer = b - a
Dim T2 As String = Mid(str1, a, gs)
Dim img2 As String
If InStr(T2, "http://news.qq.com/images/weather_p01.gif") <> 0 Then img2 = "images/1.gif" If InStr(T2, "http://news.qq.com/images/weather_p02.gif") <> 0 Then img2 = "images/2.gif" If InStr(T2, "http://news.qq.com/images/weather_p03.gif") <> 0 Then img2 = "images/3.gif" If InStr(T2, "http://news.qq.com/images/weather_p04.gif") <> 0 Then img2 = "images/4.gif"
tqimg.Text = "<img src=" & img2 & ">" Dim mystr As String = "<table width=""113"" border=""0"" cellpadding=""0"" cellspacing=""0""><tr>" Dim mystr2 As String = "</tr></table>" '加一个表格 msg.Text = strformat(mystr & T2 & mystr2) '显示内容
a = a - 5 Dim b As Integer = InStr(str1, "<td>风力</td>")
b = b - 65 Dim gs As Integer = b - a
Dim T2 As String = Mid(str1, a, gs)
Dim img2 As String
If InStr(T2, "http://news.qq.com/images/weather_p01.gif") <> 0 Then img2 = "images/1.gif" If InStr(T2, "http://news.qq.com/images/weather_p02.gif") <> 0 Then img2 = "images/2.gif" If InStr(T2, "http://news.qq.com/images/weather_p03.gif") <> 0 Then img2 = "images/3.gif" If InStr(T2, "http://news.qq.com/images/weather_p04.gif") <> 0 Then img2 = "images/4.gif"
tqimg.Text = "<img src=" & img2 & ">" Dim mystr As String = "<table width=""113"" border=""0"" cellpadding=""0"" cellspacing=""0""><tr>" Dim mystr2 As String = "</tr></table>" '加一个表格 msg.Text = strformat(mystr & T2 & mystr2) '显示内容
解决方案 »
- MediaPlayer如何应用在webForm上?
- 100分三分啦! 大家讨论一下sharepoint
- VS2005环境 运行WEB 程序为什么总是出现无法显示网页
- 在线等待数据库建表问题:
- (我没分了,不好意思)如果我想把一个web应用程序放在站点的二级目录里,应该设置些什么??
- 如何使用marquee滚动动态从数据库中提取的新闻标题? 很垃圾的问题。快进来让很砸~!~!~!很垃圾的问题。快进来让很砸~!~!~!~!==
- 请教InnerHTML一个问题
- fileupload 上传附件 该页无法显示
- 初学做了个带SQL数据表的录入、查询小网站,想要求使用特定帐号、密码登录此网站,却不知如何下手?
- 在password输入框中如何保存输入的password信息
- 将数据打印到一个已经有表格的纸上,怎么对齐?
- 辣手的问题
int a = str1.IndexOf(@"<td width=""40"">天气</td>");
a -= 5; int b = str1.IndexOf("<td>风力</td>");
b -= 65; int gs = b-a; string T2 = str1.Substring(a,gs); string img2;
if (T2.IndexOf("http://news.qq.com/images/weather_p01.gif") != -1)
img1 = "images/1.gif"; if (T2.IndexOf("http://news.qq.com/images/weather_p02.gif") != -1)
img2 = "images/1.gif"; if (T2.IndexOf("http://news.qq.com/images/weather_p03.gif") != -1)
img3 = "images/1.gif"; if (T2.IndexOf("http://news.qq.com/images/weather_p04.gif") != -1)
img4 = "images/1.gif"; tqimg.Text = "<img src=" + img2 + ">";
string mystr = @"<table width=""113"" border=""0"" cellpadding=""0"" cellspacing=""0""><tr>";
string mystr2 = @"</tr></table>";//加一表格 msg.Text = mystr + T2 + mystr2;
InStr 最终封装的是 CompareInfo的indexof 可以用String.Indexof替代
Dim a As Integer = InStr(str1, "<td width=""40"">天气</td>")int a =str1.IndexOf("<td width=""40"">天气</td>");
????
strformat 是什么?