FreeTextBox中手工上传和插入图片


    上传图片更简便和可增加简单上传视频功能。当使用File上传后,取得文件扩展名newext,在FreeTextBox内容的最后插入图片或RealPlayer视频。


newext = newext.ToLower();
this .FreeTextBox1.StartMode = EditorMode.HtmlMode;
      
if (newext == " .png " || newext == " .jpg " || newext == " .gif " || newext == " .bmp " )
      
{
       
this.FreeTextBox1.Text=this.FreeTextBox1.Text+ 
        
"<IMG src='../UploadFile/Images/"+upFileName+"' border=0>";
      }
 
    
else   if (newext == " .rm " || newext == " .ram " || newext == " .rmvb " )
      
{
       
       
this.FreeTextBox1.Text=this.FreeTextBox1.Text+ 

         
"<object id=RVOCX1 height=269 width=360 classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA name=player1 VIEWASTEXT>"+
        
"<param name='ExtentX' value='8467'>"+
        
"<param name='_ExtentY' value='6350'>"+
        
"<param name='AUTOSTART' value='-1'>"+
        
"<param name='SHUFFLE' value='0'>"+
        
"<param name='PREFETCH' value='0'>"+
        
"<param name='NOLABELS' value='0'>"+
        
"<param name='SRC' value='../UploadFile/Media/"+upFileName+"'>"+
        
"<param name='CONTROLS' value='ImageWindow'>"+
        
"<param name='CONSOLE' value='Clip1'>"+
        
"<param name='LOOP' value='0'>"+
        
"<param name='NUMLOOP' value='0'>"+
        
"<param name='CENTER' value='0'>"+
        
"<param name='MAINTAINASPECT' value='0'>"+
        
"<param name='BACKGROUNDCOLOR' value='#000000'>"+
        
"<img src='/enpadmin/edit/xhw_adv_c.jpg' align='left' border=0>"+
        
"<img src='/enpadmin/edit/xhw_adv_c.jpg' align='left' border=0>"+
        
"<img src='/enpadmin/edit/xhw_adv_c.jpg' align='left' border=0>"+
        
"<img src='/enpadmin/edit/xhw_adv_c.jpg' align='left' border=0>"+
        
"<img src='/enpadmin/edit/xhw_adv_c.jpg' align='left' border=0></object><br>"+
                        
        
"<object id=RVOCX1 height=30 width=360 classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA name=control VIEWASTEXT>"+
        
"<param name='_ExtentX' value='8467'>"+
        
"<param name='_ExtentY' value='529'>"+
        
"<param name='AUTOSTART' value='-1'>"+
        
"<param name='SHUFFLE' value='0'>"+
        
"<param name='PREFETCH' value='0'>"+
        
"<param name='NOLABELS' value='0'>"+
        
"<param name='SRC' value='../UploadFile/Media/"+upFileName+"'>"+
        
"<param name='CONTROLS' value='ControlPanel'>"+
        
"<param name='CONSOLE' value='Clip1'>"+
        
"<param name='LOOP' value='0'>"+
        
"<param name='NUMLOOP' value='0'>"+
        
"<param name='CENTER' value='0'>"+
        
"<param name='MAINTAINASPECT' value='0'>"+
        
"<param name='BACKGROUNDCOLOR' value='#000000'></object>";
        
      }

      
this .FreeTextBox1.StartMode = EditorMode.DesignMode;

你可能感兴趣的:(text)