将数据从C#WindowsForm发布到Php并更新输入值
我有一个C#应用程序,可以读取指纹,将其转换为字符串,并通过post将该字符串发送到php网站 我知道正在发送字符串,因为我从Web服务器获得了正确的响应,但它不会打开页面或类似的内容 我需要的是: 我有一页。当你按下白色按钮(“huella”)时,它会调用读取你指纹的C#应用程序将数据从C#WindowsForm发布到Php并更新输入值,c#,php,winforms,http,post,C#,Php,Winforms,Http,Post,我有一个C#应用程序,可以读取指纹,将其转换为字符串,并通过post将该字符串发送到php网站 我知道正在发送字符串,因为我从Web服务器获得了正确的响应,但它不会打开页面或类似的内容 我需要的是: 我有一页。当你按下白色按钮(“huella”)时,它会调用读取你指纹的C#应用程序 <a type="button" id="huella" href="fpp:" class="mb-xs mt-xs mr-xs btn btn-default">Huella</a> 有
<a type="button" id="huella" href="fpp:" class="mb-xs mt-xs mr-xs btn btn-default">Huella</a>
有没有办法用响应更新调用c#app页面的输入字段值?我是新来的,在寻找解决方案方面遇到了困难。这无法按照您的意愿完成。请尝试其他选项,例如不再是开发人员。可能不会更新输入并与浏览器交互,但此应用程序可能会在系统的默认浏览器上打开URL。该URL可以根据需要包含查询字符串值。
private string sendFingerprint(string fp)
{
try
{
Uri myUri = new Uri("http://localhost/demo/registrarhuella.php");
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(myUri);
req.Method = "POST";
string Data = "huella=" + fp;
byte[] postBytes = Encoding.ASCII.GetBytes(Data);
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = postBytes.Length;
Stream requestStream = req.GetRequestStream();
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();
HttpWebResponse response = (HttpWebResponse)req.GetResponse();
Stream resStream = response.GetResponseStream();
var sr = new StreamReader(response.GetResponseStream());
string responseText = sr.ReadToEnd();
return responseText;
}
catch (WebException ex)
{
MessageBox.Show(ex.Message.ToString());
return null;
}
}