locked
What is the equivalent of this PHP code to ASP.Net? RRS feed

  • Question

  • User683789433 posted

    I need to know what is the equivalent of this PHP code in ASP.Net (C #) and not how. Can anyone tell me how to do?

    <?php
    
    /* 
    With the POST method, the responses are received.
    */
    
    if (isset($_POST)) 
    {
    
    $array_resp = $_POST['row'];
    
    /* Each element of $array_resp[]is a response. The matrix structure is:
    
    $array_resp[0] = array( 
              'cel' => '1156637157',  
            'nom' => 'Juan',
            'dato' => 'DF97',
            'men' => 'Texto de la respuesta'
            'hora' => '12:56:02 18/03/13'
        );
    
    $array_resp[1] = array(...) 
    $array_resp[2] = array(...) 
    $array_resp[3] = array(...) 
    
    */  
    
    print_r($array_resp);
    
    }
    
    
    ?>

    To me they will post the array every 5 minutes and I need to keep them in the database, and do not do it because I never work with web technologies.

    Friday, February 19, 2016 3:01 PM

All replies

  • User1387599147 posted
    In case anyone would like a code snippet, Based on that link I wrote the PHP code below and it does just the trick (obviously it's hard coded right now but hey...):
    protected void Page_Load(object sender, EventArgs e)
    {
        string URL = "http://feeds2.feedburner.com/the-foreigner";
        HttpWebRequest HttpWRequest = (HttpWebRequest)WebRequest.Create(URL);
        HttpWebResponse HttpWResponse = (HttpWebResponse)HttpWRequest.GetResponse();
    
        //Read the raw HTML from the request
        StreamReader sr = new StreamReader(HttpWResponse.GetResponseStream(), Encoding.ASCII);
        //Convert the stream to a string
        string s = sr.ReadToEnd();
        sr.Close();
        Response.Write(s); 
    }
    Wednesday, July 5, 2017 6:28 AM