Retrieving data from a POST method in ASP.NET

前端 未结 3 1352
臣服心动
臣服心动 2020-12-15 03:39

I am using ASP.NET.

There is a system that needs to POST data to my site and all they asked for is for me to provide them with a URL. So I gave them my URL http://ww

3条回答
  •  臣服心动
    2020-12-15 04:11

    You can get a form value posted to a page using code similiar to this (C#) -

    string formValue;
    if (!string.IsNullOrEmpty(Request.Form["txtFormValue"]))
    {
      formValue= Request.Form["txtFormValue"];
    }
    

    or this (VB)

    Dim formValue As String
    If Not String.IsNullOrEmpty(Request.Form("txtFormValue")) Then
        formValue = Request.Form("txtFormValue")
    End If
    

    Once you have the values you need you can then construct a SQL statement and and write the data to a database.

提交回复
热议问题