登录另一个网站并通过C#.net打开页面 [英] Login Another Site And Open Page By C#.net
本文介绍了登录另一个网站并通过C#.net打开页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用我们的代码登录我们的站点到另一个站点,并打开一个我们将提到的特定页面(我已经使用了Freshdesk)
How to login our site to another site with our code and open a specific page that we will mentioned(I have used freshdesk)
推荐答案
protected void login1User(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=SYSTEM1;Initial Catalog=master;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
string sql;
sql = "select *from user1 where uname =''" + TextBox1.Text + "'' and pwd = ''" + TextBox2.Text + "''";
cmd.CommandText = sql;
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
Response.Redirect("User.aspx");
}
}
您可以在asp.net中使用Web浏览器控件.
you can use web browser control in asp.net.
使用System.Net.WebClient
或System.Net.HttpWebRequest
您可以下载任何类型的数据.如果您提供Credentials
并根据第三方网站的身份验证方法,甚至可以自动处理登录.
UsingSystem.Net.WebClient
orSystem.Net.HttpWebRequest
you can download any kind of data. If you supplyCredentials
and depending on 3rd party site authentication method, even login could be handled automaticaly.
这篇关于登录另一个网站并通过C#.net打开页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文