比如我想用C#做的桌面应用程序,来实现对某网页的操作,比如登陆,选择下拉菜单,选择单选菜单,选择多选菜单,提交,返回结果等,请问代码该怎么样写呀??应该用什么??最好给个示例代码或者给地址都可以,,,先谢谢了

解决方案 »

  1.   

    这个应该是跟.net的反射技术相关的,你去找找相关的资料吧
      

  2.   


    //post数据到某个网页并接受响应
            public static string Post( string url, string data )
            {
                string html = "";
                Encoding enc = System.Text.Encoding.GetEncoding( "GB2312" );
                 HttpWebRequest req = ( HttpWebRequest )WebRequest.Create( url );
                req.UserAgent = "Mozilla/4.0   (compatible;   MSIE   6.0;   Windows   NT   5.0;   Q312461;   .NET   CLR   1.0.3705)";
                req.Method = "POST";
                req.ContentType = "application/x-www-form-urlencoded";
                byte[] PostData = System.Text.Encoding.ASCII.GetBytes( data );
                req.ContentLength = PostData.Length;
                Stream tempStream = req.GetRequestStream();
                tempStream.Write( PostData, 0, PostData.Length );
                tempStream.Close();
                HttpWebResponse res = ( HttpWebResponse )req.GetResponse();
                StreamReader sr = new StreamReader( res.GetResponseStream(), enc );
                html = sr.ReadToEnd();
                sr.Close();
                res.Close();
                return html;
            }
      

  3.   

    using System.Text;
    using System.Net;
    using System.IO;
    //需要添加System.Web的引用
      

  4.   

    )维也纳(wien请问选单选项,下拉项,的选择参数应该是怎样用哦?如何发送``