asp.net - Request in C# Not working? -


hello looking use header push values unity project aspx string. wondering how this. can in php simple $_request(id) using like

using unityengine; using system.collections;  public class newsession : monobehaviour {                  string userloginfile = "http://local/unitysql/newsession.php?userid=";                 public unityengine.ui.text newsess;                                       string userid = "";                 string session = "";                 void ongui()                 {                                 session = newsess.text;                                 userid = playerprefs.getstring ("userid");                 }                    public void insert()                 {                                 if (session == "") {                                                 application.openurl (userloginfile +userid);                                                 //startcoroutine (loginuser (userid));                                 } else {                                                 print("damnson");                                 }                 }                     /*ienumerator loginuser(string user)                 {                                  www login = new www (userloginfile + "userid=" + user);                                 print (userloginfile + "userid=" + user);                                 yield return login;                                  if (login.error == null)                                 {                                                  string[] credentials = login.text.split('/');                                                  foreach(string str in credentials)                                                 {                                                                 string[] creds = str.split ('=');                                                                  for(int i=0; < creds.length; i++)                                                                 {                                                                                 print ("winner");                                                                 }                                                   }                                 }                  }*/ }  php simple                  $userid = $_request['userid']; 

uid = $_request(id);

i wondering how using c# in advance

i think want handle on http request. take @ https://msdn.microsoft.com/en-us/library/system.web.httprequest%28v=vs.110%29.aspx

example documentation:

    public partial class addtocart : page {     protected void page_load(object sender, eventargs e)     {         string rawid = request["productid"];         int productid;         if (!string.isnullorempty(rawid) && int.tryparse(rawid, out productid))         {             using (shoppingcartactions usersshoppingcart = new shoppingcartactions())             {                 usersshoppingcart.addtocart(productid);             }         }         else         {             throw new exception("tried call addtocart.aspx without setting productid.");         }         response.redirect("shoppingcart.aspx");     } } 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -