本文整理匯總了C#中TPortalClass.JpCommon.GetImg方法的典型用法代碼示例。如果您正苦於以下問題:C# JpCommon.GetImg方法的具體用法?C# JpCommon.GetImg怎麽用?C# JpCommon.GetImg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TPortalClass.JpCommon
的用法示例。
在下文中一共展示了JpCommon.GetImg方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: btnFB_Click
//發布
protected void btnFB_Click(object sender, EventArgs e)
{
if (this.Session["uid"].ToString() == "")
this.Response.Redirect("../login.aspx");
string ls_tip = "發布成功!";
//新文檔時
TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
JpArticle.cid = this.txtcid.Text;
JpArticle.title = this.txttitle.Text;
JpArticle.subhead = this.txttitle2.Text;
JpArticle.ht_content = this.content1.Value;
if (this.txtsummary.Text == "")
{
JpArticle.summary = JpCommon.OutPicGetStr(this.content1.Value, 150);
}
else
{
JpArticle.summary = this.txtsummary.Text;
}
JpArticle.author = this.Session["uname"].ToString();
JpArticle.status = "發布";
//JpArticle.ifindexdisplay = "";
string lsfilename = FileUpload1.FileName;
string lspath = "";
string lsurl = "";
string str_path = "";
if (lsfilename != "") //attsize
{
//SaveCommon(ls_path, ls_attsize, lsguid);
//將附件上傳到服務器目錄下
lspath = Server.MapPath("~/");//虛擬目錄的位置
lsurl = "/upload/indexpic"; //存放的文件夾
Directory.CreateDirectory(lspath + "/" + lsurl);
str_path = lspath + "/" + lsurl + "/" + lsfilename;
FileUpload1.SaveAs(str_path);
JpArticle.indexdisplaypicpath = lsurl + "/" + lsfilename;
}
else
{
this.txtpic.Value = JpCommon.GetImg(this.content1.Value);
JpArticle.indexdisplaypicpath = this.txtpic.Value;
}
if (this.txtseotitle.Text == "")
{
JpArticle.seotitle = this.txttitle.Text;
}
else
{
JpArticle.seotitle = this.txtseotitle.Text;
}
if (this.txtseokeywords.Text == "")
{
JpArticle.seokeywords = this.txttitle.Text;
}
else
{
JpArticle.seokeywords = this.txtseokeywords.Text;
}
if (this.txtseodescription.Text == "")
{
JpArticle.seodescription = JpCommon.OutPicGetStr(this.content1.Value, 150);
}
else
{
JpArticle.seodescription = this.txtseodescription.Text;
}
JpArticle.asort = System.Int32.Parse(this.txtasort.Text);
JpArticle.iftop = this.ddlsfzd.SelectedValue;
JpArticle.topendtime = this.txttopendtime.Value;
JpArticle.ifindexdisplay = this.ddlsfsyss.SelectedValue;
JpArticle.ifcomment = "0";
JpArticle.source = this.txtsource.Value;
JpArticle.role_userid = this.txtrole_userid.Text;
JpArticle.role_username = this.txtrole_username.Text;
JpArticle.input = this.Session["uid"].ToString();
JpArticle.GUID = this.txtguid.Text;
if (ddllb.SelectedValue != "請選擇")
{
JpArticle.map_cid = ddllb.SelectedValue;
}
else
{
JpArticle.map_cid = "";
}
JpArticle.map_aid = 0;
JpArticle.targettype = "";
JpArticle.hits = 0;
JpArticle.goodnum = 0;
if (radlist.SelectedValue == "否")
{
JpArticle.sfzwd = radlist.SelectedValue;
JpArticle.zwdid = ddlwz.SelectedValue;
}
else
//.........這裏部分代碼省略.........
示例2: btnSave_Click
//保存
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.Session["uid"].ToString() == "")
this.Response.Redirect("../login.aspx");
string ls_tip = "保存成功!";
//新文檔時
TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
JpArticle.cid = this.ddlcolname.SelectedValue;
JpArticle.title = this.txttitle.Text;
JpArticle.subhead = this.txttitle2.Text;
JpArticle.ht_content = this.content1.Value;
if (this.txtsummary.Text == "")
{
JpArticle.summary = JpCommon.OutPicGetStr(this.content1.Value, 150);
}
else
{
JpArticle.summary = this.txtsummary.Text;
}
JpArticle.author = this.Session["uname"].ToString();
if (this.txtstatus.Text == "")
{
JpArticle.status = "編輯";
}
else
{
JpArticle.status = this.txtstatus.Text;
}
//JpArticle.ifindexdisplay = "";
string lsfilename = FileUpload1.FileName;
string lspath = "", lsurl = "", lsurl2 = "", str_path = "", str_path2 = "";
if (lsfilename != "") //attsize
{
lsfilename = this.txtguid.Text + "_" + lsfilename;
//SaveCommon(ls_path, ls_attsize, lsguid);
//將附件上傳到服務器目錄下
lspath = Server.MapPath("~/"); //虛擬目錄的位置
lsurl = "/upload/indexpic_yt"; //原圖存放的文件夾
lsurl2 = "/upload/indexpic"; //縮略圖存放的文件夾
Directory.CreateDirectory(lspath + "/" + lsurl);
Directory.CreateDirectory(lspath + "/" + lsurl2);
str_path = lspath + "/" + lsurl + "/" + lsfilename;
str_path2 = lspath + "/" + lsurl2 + "/" + lsfilename;
FileUpload1.SaveAs(str_path);
//壓縮圖片處理
MakeThumbnail(str_path, str_path2, 600, 600, "HW");
JpArticle.indexdisplaypicpath = lsurl2 + "/" + lsfilename;
}
else
{
this.txtpic.Value = JpCommon.GetImg(this.content1.Value);
JpArticle.indexdisplaypicpath = this.txtpic.Value;
}
if (this.txtseotitle.Text == "")
{
JpArticle.seotitle = this.txttitle.Text;
}
else
{
JpArticle.seotitle = this.txtseotitle.Text;
}
if (this.txtseokeywords.Text == "")
{
JpArticle.seokeywords = this.txttitle.Text;
}
else
{
JpArticle.seokeywords = this.txtseokeywords.Text;
}
if (this.txtseodescription.Text == "")
{
JpArticle.seodescription = JpCommon.OutPicGetStr(this.content1.Value, 150);
}
else
{
JpArticle.seodescription = this.txtseodescription.Text;
}
JpArticle.seodescription = this.txtseodescription.Text;
JpArticle.asort = System.Int32.Parse(this.txtasort.Text);
JpArticle.iftop = this.ddlsfzd.SelectedValue;
JpArticle.topendtime = this.txttopendtime.Value;
JpArticle.ifindexdisplay = this.ddlsfsyss.SelectedValue;
JpArticle.ifcomment = "0";
JpArticle.source = this.txtsource.Value;
JpArticle.role_userid = this.txtrole_userid.Text;
JpArticle.role_username = this.txtrole_username.Text;
JpArticle.input = this.Session["uid"].ToString();
JpArticle.GUID = this.txtguid.Text;
if (ddllb.SelectedValue != "請選擇")
{
JpArticle.map_cid = ddllb.SelectedValue;
}
//.........這裏部分代碼省略.........