信息发布系统源代码文档格式.docx
- 文档编号:22230167
- 上传时间:2023-02-03
- 格式:DOCX
- 页数:84
- 大小:40.03KB
信息发布系统源代码文档格式.docx
《信息发布系统源代码文档格式.docx》由会员分享,可在线阅读,更多相关《信息发布系统源代码文档格式.docx(84页珍藏版)》请在冰豆网上搜索。
/param>
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)
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["
].ToString();
item.Describe=dataRow["
describe"
item.Remark=dataRow["
templateName"
item.OtherInfo=(dataRow["
templateId"
].ToString()=="
?
-1"
:
dataRow["
].ToString())+"
+(dataRow["
docTemplateId"
classDeptId"
item.Abbreviate=(dataRow["
itemNumber"
0"
item.Enabled=(dataRow["
enabled"
True"
true:
false);
item.Value=dataRow["
classType"
//item.Image=(item.Enabled?
FunkeLab.MyTreeView.ImagesFolder+"
Node_Enable.gif"
FunkeLab.MyTreeView.ImagesFolder+"
Node_Disable.gif"
if(newClasses().GetChildClassesCountById(int.Parse(dataRow["
].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["
if(TreeView1.GetNodeById(id).Items.Count>
return0;
return1;
///设置targetFrame.Item请传为null
publicvoidSetTargetFrame(stringnewTargetFrame,stringnewLinkUrl,FunkeLab.MyTreeViewItemItem)
targetFrame=newTargetFrame;
linkUrl=newLinkUrl;
FunkeLab.MyTreeViewItemCollectionitemCollection;
if(Item==null)
for(inti=0;
i<
itemCollection.Count;
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.Net;
usingSystem.IO;
usingSystem.Text;
usingSystem.Net.Sockets;
usingSystem.Diagnostics;
usingSystem.Runtime.Remoting;
usingSystem.Runtime.Remoting.Messaging;
/*
*libraryinC#
*Author:
JaimonMathew
*mailto:
*
*AddaptedforusebyDanGlass07/03/03
*/
namespace
publicclass
publicclass:
Exception
public(stringmessage):
base(message){}
public(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
public()
///
server"
username"
password"
public(stringserver,stringusername,stringpassword)
this.server=server;
this.username=username;
this.password=password;
timeoutSeconds"
port"
public(stringserver,stringusername,stringpassword,inttimeoutSeconds,intport)
this.timeoutSeconds=timeoutSeconds;
this.port=port;
///Displayallcommunicationstothedebuglog
publicboolVerboseDebugging
get
returnthis.verboseDebugging;
set
this.verboseDebugging=value;
///Remoteserverport.TypicallyTCP21
publicintPort
returnthis.port;
this.port=value;
///Timeoutwaitingforaresponsefromserver,inseconds.
publicintTimeout
returnthis.timeoutSeconds;
this.timeoutSeconds=value;
///GetsandSetsthenameofthe.
returns>
/returns>
publicstringServer
returnthis.server;
this.server=value;
///GetsandSetstheportnumber.
publicintRemotePort
///GetSandSetstheremotedirectory.
publicstringRemotePath
returnthis.remotePath;
this.remotePath=value;
///GetsandSetstheusername.
publicstringUsername
returnthis.username;
this.username=value;
///GetsandSetthepassword.
publicstringPassword
returnthis.password;
this.password=value;
///Ifthevalueofmodeistrue,setbinarymodefordownloads,else,Asciimode.
publicboolBinaryMode
returnthis.binMode;
if(this.binMode==value)return;
if(value)
sendCommand("
TYPEI"
TYPEA"
if(this.resultCode!
=200)thrownew(result.Substring(4));
///Logintotheremoteserver.
publicvoidLogin()
if(this.loggedin)this.Close();
Debug.WriteLine("
Openingconnectionto"
+this.server,"
);
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();
thrownew("
Couldn'
tconnecttoremoteserver"
ex);
this.readResponse();
if(this.resultCode!
=220)
this.Close();
thrownew(this.result.Substring(4));
this.sendCommand("
USER"
+username);
if(!
(this.resultCode==331||this.resultCode==230))
this.cleanup();
if(this.resultCode!
=230)
this.sendCommand("
PASS"
+password);
if(!
(this.resultCode==230||this.resultCode==202))
this.cleanup();
thrownew(this.result.Substring(4));
this.loggedin=true;
Debug.WriteLine("
Connectedto"
this.ChangeDir(this.remotePath);
///Closethe.
publicvoidClose()
Closingconnectionto"
if(this.clientSocket!
=null)
this.sendCommand("
QUIT"
this.cleanup();
///Returnastringarraycontainingtheremotedirectory'
s.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 信息 发布 系统 源代码