?? index.aspx.cs
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Security;
using System.Data.SqlClient;
using System.Configuration;
using webihClass;
namespace ConfirmWebDisk.friendshare
{
/// <summary>
/// index 的摘要說明。
/// </summary>
public class index : System.Web.UI.Page
{
public string HiveId,iHiveId,typesize,dateString,iH_wwwServer,AttachHiveID;
protected System.Web.UI.WebControls.Table iDeskShareListTable;
protected System.Web.UI.WebControls.Button addBtn;
protected System.Web.UI.WebControls.TextBox TextBox1;
webihClass.iHiveIDClass iHive = new iHiveIDClass();
public string mail,rss,collection,search,web,tool;
private void Page_Load(object sender, System.EventArgs e)
{
bool IsAuthen;
iHiveId = Request.Params[0].ToString();//我的蜂盤號碼
Session["persondiskid"] = iHiveId;
HiveId = Request.Params[1].ToString();//蜂盤驗證號碼
typesize = Request.Params[2].ToString();//蜂盤大小
AttachHiveID = Request.Params[3].ToString();//附加驗證碼
IsAuthen = iHive.IsAuthiHiveID( iHiveId,typesize,HiveId );
//if( IsAuthen == true && iHive.IsAttachHiveID(AttachHiveID) && Convert.ToBoolean(Request.Cookies["UserInfo"]["IsLogin"]))
if( IsAuthen == true )
{
iH_wwwServer = iH_ServerAddr(iHiveId);
iHiveFriendShareList(iHiveId);
}
else
{
Response.Write("<script>alert('系統超時,現在返回登錄頁面!');location.href='../JLService/Client_SSO.aspx'</script>");
}
DataSet ds = new DataSet();
APP.DataBase DB = new ConfirmWebDisk.friendshare.APP.DataBase();
ds = DB.ExecuteStoreProc("JL_APPWeb");
Random rd = new Random(10000);
mail = ds.Tables[0].Rows[0][0].ToString()+"?Uid="+Session["persondiskid"].ToString()+"&id="+rd.Next().ToString()+"&pid="+(((Convert.ToUInt64(Session["persondiskid"].ToString())+49)*2-1001)*3).ToString();
rss = ds.Tables[0].Rows[1][0].ToString()+"?Uid="+Session["persondiskid"].ToString()+"&id="+rd.Next().ToString()+"&pid="+(((Convert.ToUInt64(Session["persondiskid"].ToString())+49)*2-1001)*3).ToString();
collection = ds.Tables[0].Rows[2][0].ToString()+"?Uid="+Session["persondiskid"].ToString()+"&id="+rd.Next().ToString()+"&pid="+(((Convert.ToUInt64(Session["persondiskid"].ToString())+49)*2-1001)*3).ToString();
search = ds.Tables[0].Rows[3][0].ToString()+"?Uid="+Session["persondiskid"].ToString()+"&id="+rd.Next().ToString()+"&pid="+(((Convert.ToUInt64(Session["persondiskid"].ToString())+49)*2-1001)*3).ToString();
web = ds.Tables[0].Rows[4][0].ToString()+"?Uid="+Session["persondiskid"].ToString()+"&id="+rd.Next().ToString()+"&pid="+(((Convert.ToUInt64(Session["persondiskid"].ToString())+49)*2-1001)*3).ToString();
tool = ds.Tables[0].Rows[4].ToString()+"?Uid="+Session["persondiskid"].ToString()+"&id="+rd.Next().ToString()+"&pid="+(((Convert.ToUInt64(Session["persondiskid"].ToString())+49)*2-1001)*3).ToString();
// 在此處放置用戶代碼以初始化頁面
}
#region Web 窗體設計器生成的代碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 該調用是 ASP.NET Web 窗體設計器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void iHiveFriendShareList(string UserID )
{
string ConnectionString = ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection connect = new SqlConnection( ConnectionString );
SqlCommand command = new SqlCommand("JL_FriendUserList",connect);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@FriendUserID",SqlDbType.BigInt,18,"FriendUserID");
command.Parameters["@FriendUserID"].Value = UserID;
TableCell tc;
TableRow tr;
HyperLink hlink;
System.Web.UI.WebControls.Image im;
connect.Open();
SqlDataReader reader = command.ExecuteReader();
while( reader.Read() )
{
tr = new TableRow();
tc = new TableCell();
im = new System.Web.UI.WebControls.Image();
im.ImageUrl = "../img/ihivefriend.jpg";
tc.Controls.Add(im);
tc.HorizontalAlign = HorizontalAlign.Center;
tr.Cells.Add(tc);
tc = new TableCell();
hlink = new HyperLink();
hlink.Text = GetLoginID(reader["UserID"].ToString());
string UserFriendSha = iHive.GetShareiHiveID(iHiveId,reader["UserID"].ToString());
string src = "friendsharelogin.aspx?UserId="+iHiveId+"&iHiveId="+HiveId+"&typesize="+typesize+"&UserFriendID="+reader["UserID"].ToString()+"&UFriendID="+UserFriendSha;
hlink.Attributes.Add("style","cursor:hand");
hlink.Attributes.Add("onclick","javascript:iframelocation('"+src+"','"+reader["UserID"].ToString()+"')");
tc.Attributes.Add("onmouseover","bgColor ='#EDF1F4'");
tc.Attributes.Add("onmouseout","bgColor = '#FFFFFF'");
tc.HorizontalAlign = HorizontalAlign.Left;
tc.Controls.Add( hlink );
tr.Cells.Add(tc);
iDeskShareListTable.Rows.Add(tr);
}
reader.Close();
connect.Close();
}
private string iH_ServerAddr(string iHiveID)//我的蜂盤服務地址
{
string iHiveServerAddr = "http://jlwt.1g.cn/webdisk/";
SqlConnection Connection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand Command = new SqlCommand("Select Hive_www From HD_ServerList",Connection);
Connection.Open();
iHiveServerAddr = Command.ExecuteScalar().ToString();
Connection.Close();
/*SqlConnection Connection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand Command = new SqlCommand("SP_iHiveServerAddr",Connection);
Command.CommandType = CommandType.StoredProcedure;
Command.Parameters.Add("@iHiveID",SqlDbType.Int,4);
Command.Parameters.Add("@iH_www",SqlDbType.VarChar,50,"iH_www");
Command.Parameters["@iH_www"].Direction = ParameterDirection.Output;
Command.Parameters["@iHiveID"].Value = iHiveID;
Connection.Open();
Command.ExecuteNonQuery();
iHiveServerAddr = Command.Parameters["@iH_www"].Value.ToString();
Connection.Close();*/
return iHiveServerAddr;
}
private string GetLoginID(string vdiskid)
{
string loginId;
SqlConnection Connection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand Command = new SqlCommand("Select loginID From JL_Tv_UserInfo Where vdiskid='"+vdiskid+"'",Connection);
Connection.Open();
loginId = Command.ExecuteScalar().ToString();
Connection.Close();
return loginId;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -