以下是引用片段:
//cdepartmentinfo 类别实体类
//sjid :与大类别关联id
//space:只是一个标记
//stropinion用来存放类名
string sjid = "0";
string space = "+";
string stropinion = "";
string paths = @"e:/test";
string file_name = paths + "//bmcategory.xml";
flag = true;
streamwriter sr = file.createtext( "bmcategory" );
sr.close();
streamwriter x = new streamwriter( file_name, true, system.text.encoding.default );
x.write( "<r>");
display( sjid, space, ref icount,x );
x.write( "</r>" );
x.close();
以下是引用片段: public void display( string sjid, string space, ref int icount,streamwriter x ) { list<cdepartmentinfo> departmentlist = new list<cdepartmentinfo>(); departmentlist = organizationrule.getlist( sjid );//读取一个列表类,这里是list foreach ( cdepartmentinfo aa in departmentlist ) { stropinion = aa.bm_categoryname.trim().tostring(); x.write( "<dstree"+aa.bm_categorylxpm.trim()+" text=/"" + aa.bm_categoryname.trim() + "/" treeid=/"" + aa.bm_categorylxpm.trim() + "/" mspace=/"栏目管理/">"+ stropinion ); x.write( "/r/n" ); display( aa.bm_categorylxpm.tostring().trim(), text + space, ref icount,x ); x.write( "</dstree" + aa.bm_categorylxpm.trim() + ">" ); } |
新闻热点
疑难解答
图片精选