你使用的是HTML控件,也可能是我没太明白你的意思。不过,你好像是说,提交后数据还保持在那里吗?如果是这样,其实就是一个状态保持的问题,你把以上控件换成ASP。NET控件就可以解决了。因为。NET中的WEB FORM控件对数据的状态会在服务器端进行保持的。不知你说的是不是这个意思。

解决方案 »

  1.   

    you can consult one of the articles in .Net quickstart examples, here is the link:
    How Do I...Make a POST request?
    http://samples.gotdotnet.com/quickstart/howto/doc/WebRequests/clientPOST.aspxsomething like this:using System;
    using System.Net;
    using System.IO;
    using System.Text;
    using System.Web;
     public static void getPage(String url, String payload) {
            try {            WebRequest req = WebRequest.Create(url);
                req.Method = "POST";
                req.ContentType = "application/x-www-form-urlencoded";
            StringBuilder UrlEncoded = new StringBuilder();
            Char[] reserved = {'?', '=', '&'};
            byte[] SomeBytes = null;        if (payload != null) {
            int i=0, j;
            while(i<payload.Length){
                j=payload.IndexOfAny(reserved, i);
                if (j==-1){
                UrlEncoded.Append(HttpUtility.UrlEncode(payload.Substring(i, payload.Length-i)));
                break;
                }
                UrlEncoded.Append(HttpUtility.UrlEncode(payload.Substring(i, j-i)));
                UrlEncoded.Append(payload.Substring(j,1));
                i = j+1;
            }
            SomeBytes = Encoding.UTF8.GetBytes(UrlEncoded.ToString());
                    req.ContentLength = SomeBytes.Length;
                    Stream newStream = req.GetRequestStream();
            newStream.Write(SomeBytes, 0, SomeBytes.Length);
                    newStream.Close();
                } else {
                    req.ContentLength = 0;
                }
                WebResponse result = req.GetResponse();
                Stream ReceiveStream = result.GetResponseStream();
                Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
                StreamReader sr = new StreamReader( ReceiveStream, encode );
                Console.WriteLine("\r\nResponse stream received");
                Char[] read = new Char[256];
                int count = sr.Read( read, 0, 256 );
                Console.WriteLine("HTML...\r\n");
                while (count > 0) {
                    String str = new String(read, 0, count);
                    Console.Write(str);
                    count = sr.Read(read, 0, 256);
                }
                Console.WriteLine("");
            } catch(Exception e) {
            Console.WriteLine( e.ToString());
                Console.WriteLine("\r\nThe request URI could not be found or was malformed");
            }
        }
      

  2.   

    我说的不是aspx是.exe的客户端程序。
      

  3.   

    无为:I服了YOU!!
    你怎么什么问题都会啊?你好象是百科全书啊。asp js vbs 现在连c#就都有资料。
    真是佩服!!佩服!!