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) '显示内容

解决方案 »

  1.   

    帮你翻译完了。
    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;
      

  2.   

    其实VB.net那些全局函数也是封装的.net,函数,
    InStr 最终封装的是  CompareInfo的indexof 可以用String.Indexof替代
    Dim a As Integer = InStr(str1, "<td width=""40"">天气</td>")int a =str1.IndexOf("<td width=""40"">天气</td>");
    ????
    strformat 是什么?