これは私のASHX
です。リクエストURLから複数のパラメータを取得するファイルはhttpcontext
です。正しく動作しますが、ハッシュURLを介してテキストパラメータの(#)値を取得します。別のパラメータであるFLOWの値を取っていません(Textパラメータの隣)。 ASHXファイル内の複数の値を持つURLからシャープ記号(#)をキャッチする方法
http://localhost:10326/ussd.ashx?user=MSL&pass=MSL663055&tid=65506&msisdn=8801520101525&text=***3333**&flow=begin&momt=mo
そして、それはのために働いていません。
http://localhost:10326/ussd.ashx?user=MSL&pass=MSL663055&tid=65506&msisdn=8801520101525&text=***3333#**&flow=begin&momt=mo
私ASHXファイル:あなたのパラメータ値をエンコードするURIに必要
public void ProcessRequest(HttpContext context)
{
HttpRequest httpRequest = context.Request;
string user = httpRequest.QueryString["user"].ToString();
string pass = httpRequest.QueryString["pass"].ToString();
string tid = httpRequest.QueryString["tid"].ToString();
string msisdn = httpRequest.QueryString["msisdn"].ToString();
string text = httpRequest.QueryString["text"].ToString();
flow = httpRequest.QueryString["flow"].ToString();
HttpContext.Current.Session["user"] = user;
HttpContext.Current.Session["pass"] = pass;
HttpContext.Current.Session["tid"] = tid;
HttpContext.Current.Session["msisdn"] = msisdn;
HttpContext.Current.Session["text"] = text;
HttpContext.Current.Session["flow"] = flow;
正しいですが、URLエンコーディングの機能は.Net: 'Httputility.UrlEncode()'、Javascript: 'encodeURI()'または 'encodeURIComponent()'です。 – par
セクション3は素晴らしい[ASCIIグラフ](https:// tools.ietf.org/html/rfc3986#section-3)、断片を含むURI部分を表示します –