信息发布系统源代码.docx

上传人:b****4 文档编号:4892560 上传时间:2023-05-07 格式:DOCX 页数:86 大小:40.54KB
下载 相关 举报
信息发布系统源代码.docx_第1页
第1页 / 共86页
信息发布系统源代码.docx_第2页
第2页 / 共86页
信息发布系统源代码.docx_第3页
第3页 / 共86页
信息发布系统源代码.docx_第4页
第4页 / 共86页
信息发布系统源代码.docx_第5页
第5页 / 共86页
信息发布系统源代码.docx_第6页
第6页 / 共86页
信息发布系统源代码.docx_第7页
第7页 / 共86页
信息发布系统源代码.docx_第8页
第8页 / 共86页
信息发布系统源代码.docx_第9页
第9页 / 共86页
信息发布系统源代码.docx_第10页
第10页 / 共86页
信息发布系统源代码.docx_第11页
第11页 / 共86页
信息发布系统源代码.docx_第12页
第12页 / 共86页
信息发布系统源代码.docx_第13页
第13页 / 共86页
信息发布系统源代码.docx_第14页
第14页 / 共86页
信息发布系统源代码.docx_第15页
第15页 / 共86页
信息发布系统源代码.docx_第16页
第16页 / 共86页
信息发布系统源代码.docx_第17页
第17页 / 共86页
信息发布系统源代码.docx_第18页
第18页 / 共86页
信息发布系统源代码.docx_第19页
第19页 / 共86页
信息发布系统源代码.docx_第20页
第20页 / 共86页
亲,该文档总共86页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

信息发布系统源代码.docx

《信息发布系统源代码.docx》由会员分享,可在线阅读,更多相关《信息发布系统源代码.docx(86页珍藏版)》请在冰点文库上搜索。

信息发布系统源代码.docx

信息发布系统源代码

usingSystem;

usingSystem.Data;

usingFuYang.Web.Class.Business;

namespaceFuYang.Web.InfoPub.Business

{

///

///ClassPublishTree的摘要说明。

///

publicclassClassPublishTree

{

privateFunkeLab.MyTreeViewTreeView1;

privatestringtargetFrame="";

privatestringlinkUrl="";

publicClassPublishTree(FunkeLab.MyTreeViewMyTreeView)

{

//

//TODO:

在此处添加构造函数逻辑

//

TreeView1=MyTreeView;

FunkeLab.MyTreeView.ImagesFolder=FuYang.Config.ModuleConfig.GetSettings().ImagePath;

}

///

///显示树节点,Item.Remark=templateName,Item.OtherInfo=templateId

///

///

publicvoidShowNode(FunkeLab.MyTreeViewItemItem,DataTabledataTable)

{

if(dataTable.Rows.Count==0)

{

TreeView1.Items.Clear();

FunkeLab.MyTreeViewItemitem=newFunkeLab.MyTreeViewItem("栏目列表","","","");

item.Id=-1;

TreeView1.Items.Add(item);

return;

}

FunkeLab.MyTreeViewItemchildItem=null;

FunkeLab.MyTreeViewItemCollectionitemCollection=null;

if(Item==null)

{

TreeView1.Items.Clear();

itemCollection=TreeView1.Items;

}

else

{

if((Item.Items.Count!

=1)||(Item.Items[0].Id!

=-1))

{

return;

}

Item.Items.Clear();

itemCollection=Item.Items;

}

foreach(DataRowdataRowindataTable.Rows)

{

FunkeLab.MyTreeViewItemitem=newFunkeLab.MyTreeViewItem(dataRow["name"].ToString(),"","","");

item.Id=int.Parse(dataRow["id"].ToString());

item.Name=dataRow["name"].ToString();

item.Describe=dataRow["describe"].ToString();

item.Remark=dataRow["templateName"].ToString();

item.OtherInfo=(dataRow["templateId"].ToString()==""?

"-1":

dataRow["templateId"].ToString())+";"+(dataRow["docTemplateId"].ToString()==""?

"-1":

dataRow["docTemplateId"].ToString())+";"+(dataRow["classDeptId"].ToString()==""?

"-1":

dataRow["classDeptId"].ToString())+";";

item.Abbreviate=(dataRow["itemNumber"].ToString()==""?

"0":

dataRow["itemNumber"].ToString());

item.Enabled=(dataRow["enabled"].ToString()=="True"?

true:

false);

item.Value=dataRow["classType"].ToString();

//item.Image=(item.Enabled?

FunkeLab.MyTreeView.ImagesFolder+"Node_Enable.gif":

FunkeLab.MyTreeView.ImagesFolder+"Node_Disable.gif");

if(newClasses().GetChildClassesCountById(int.Parse(dataRow["id"].ToString()))>0)

{

childItem=newFunkeLab.MyTreeViewItem("","","","");

childItem.Id=-1;

item.Items.Add(childItem);

}

else

{

item.Selector=FunkeLab.MyTreeViewItem.SelectionMode.CheckBox;

}

itemCollection.Add(item);

}

}

///

///通过站点ID得到该站点所有栏目

///

publicboolGetClassBySiteId(intsiteId)

{

TreeView1.Items.Clear();

DataTabledataTable=newClasses().GetClassesBySiteId(siteId);

ShowNode(null,dataTable);

returntrue;

}

///

///判断当前节点是否叶节点.是:

返回1:

不是:

0;无选中节点:

-1

///

publicintisLeafNode()

{

if(System.Web.HttpContext.Current.Session["ClassId"]==null)

{

return-1;

}

intid=int.Parse(System.Web.HttpContext.Current.Session["ClassId"].ToString());

if(TreeView1.GetNodeById(id).Items.Count>0)

{

return0;

}

return1;

}

///

///设置targetFrame.Item请传为null

///

publicvoidSetTargetFrame(stringnewTargetFrame,stringnewLinkUrl,FunkeLab.MyTreeViewItemItem)

{

targetFrame=newTargetFrame;

linkUrl=newLinkUrl;

FunkeLab.MyTreeViewItemCollectionitemCollection;

if(Item==null)

{

itemCollection=TreeView1.Items;

}

else

{

itemCollection=Item.Items;

}

for(inti=0;i

{

itemCollection[i].TargetFrame=targetFrame;

itemCollection[i].Link=newLinkUrl+"?

ClassId="+itemCollection[i].Id.ToString()+"';";

if(itemCollection[i].Items.Count>0)

SetTargetFrame(newTargetFrame,linkUrl,itemCollection[i]);

}

}

}

}

usingSystem;

usingSystem.Net;

usingSystem.IO;

usingSystem.Text;

usingSystem.Net.Sockets;

usingSystem.Diagnostics;

usingSystem.Runtime.Remoting;

usingSystem.Runtime.Remoting.Messaging;

/*

*FTPClientlibraryinC#

*Author:

JaimonMathew

*mailto:

***************************

*

*

*AddaptedforusebyDanGlass07/03/03

*/

namespaceFTPClient

{

publicclassFtpClient

{

publicclassFtpException:

Exception

{

publicFtpException(stringmessage):

base(message){}

publicFtpException(stringmessage,ExceptioninnerException):

base(message,innerException){}

}

privatestaticintBUFFER_SIZE=512;

privatestaticEncodingASCII=Encoding.ASCII;

privateboolverboseDebugging=false;

//defaults

privatestringserver="localhost";

privatestringremotePath=".";

privatestringusername="anonymous";

privatestringpassword="***********************";

privatestringmessage=null;

privatestringresult=null;

privateintport=21;

privateintbytes=0;

privateintresultCode=0;

privateboolloggedin=false;

privateboolbinMode=false;

privateByte[]buffer=newByte[BUFFER_SIZE];

privateSocketclientSocket=null;

privateinttimeoutSeconds=10;

///

///Defaultcontructor

///

publicFtpClient()

{

}

///

///

///

///

///

///

publicFtpClient(stringserver,stringusername,stringpassword)

{

this.server=server;

this.username=username;

this.password=password;

}

///

///

///

///

///

///

///

///

publicFtpClient(stringserver,stringusername,stringpassword,inttimeoutSeconds,intport)

{

this.server=server;

this.username=username;

this.password=password;

this.timeoutSeconds=timeoutSeconds;

this.port=port;

}

///

///Displayallcommunicationstothedebuglog

///

publicboolVerboseDebugging

{

get

{

returnthis.verboseDebugging;

}

set

{

this.verboseDebugging=value;

}

}

///

///Remoteserverport.TypicallyTCP21

///

publicintPort

{

get

{

returnthis.port;

}

set

{

this.port=value;

}

}

///

///Timeoutwaitingforaresponsefromserver,inseconds.

///

publicintTimeout

{

get

{

returnthis.timeoutSeconds;

}

set

{

this.timeoutSeconds=value;

}

}

///

///GetsandSetsthenameoftheFTPserver.

///

///

publicstringServer

{

get

{

returnthis.server;

}

set

{

this.server=value;

}

}

///

///GetsandSetstheportnumber.

///

///

publicintRemotePort

{

get

{

returnthis.port;

}

set

{

this.port=value;

}

}

///

///GetSandSetstheremotedirectory.

///

publicstringRemotePath

{

get

{

returnthis.remotePath;

}

set

{

this.remotePath=value;

}

}

///

///GetsandSetstheusername.

///

publicstringUsername

{

get

{

returnthis.username;

}

set

{

this.username=value;

}

}

///

///GetsandSetthepassword.

///

publicstringPassword

{

get

{

returnthis.password;

}

set

{

this.password=value;

}

}

///

///Ifthevalueofmodeistrue,setbinarymodefordownloads,else,Asciimode.

///

publicboolBinaryMode

{

get

{

returnthis.binMode;

}

set

{

if(this.binMode==value)return;

if(value)

sendCommand("TYPEI");

else

sendCommand("TYPEA");

if(this.resultCode!

=200)thrownewFtpException(result.Substring(4));

}

}

///

///Logintotheremoteserver.

///

publicvoidLogin()

{

if(this.loggedin)this.Close();

Debug.WriteLine("Openingconnectionto"+this.server,"FtpClient");

IPAddressaddr=null;

IPEndPointep=null;

try

{

this.clientSocket=newSocket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);

addr=Dns.Resolve(this.server).AddressList[0];

ep=newIPEndPoint(addr,this.port);

this.clientSocket.Connect(ep);

}

catch(Exceptionex)

{

//doubtfull

if(this.clientSocket!

=null&&this.clientSocket.Connected)this.clientSocket.Close();

thrownewFtpException("Couldn'tconnecttoremoteserver",ex);

}

this.readResponse();

if(this.resultCode!

=220)

{

this.Close();

thrownewFtpException(this.result.Substring(4));

}

this.sendCommand("USER"+username);

if(!

(this.resultCode==331||this.resultCode==230))

{

this.cleanup();

thrownewFtpException(this.result.Substring(4));

}

if(this.resultCode!

=230)

{

this.sendCommand("PASS"+password);

if(!

(this.resultCode==230||this.resultCode==202))

{

this.cleanup();

thrownewFtpException(this.result.Substring(4));

}

}

this.loggedin=true;

Debug.WriteLine("Connectedto"+this.server,"FtpClient");

this.ChangeDir(this.remotePath);

}

///

///ClosetheFTPconnection.

///

publicvoi

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 自然科学 > 生物学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2