登录另一个网站并通过C#.net打开页面 [英] Login Another Site And Open Page By C#.net

查看:96
本文介绍了登录另一个网站并通过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.WebClientSystem.Net.HttpWebRequest您可以下载任何类型的数据.如果您提供Credentials并根据第三方网站的身份验证方法,甚至可以自动处理登录.
Using System.Net.WebClient or System.Net.HttpWebRequest you can download any kind of data. If you supply Credentials and depending on 3rd party site authentication method, even login could be handled automaticaly.


这篇关于登录另一个网站并通过C#.net打开页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆