Esempio n. 1
0
        /// <summary>
        /// 创建显示图像的标签(重载),无宽高限制,(flash加点击)
        /// </summary>
        public static string CreateTag(string ADID, string filename, string desc, string FileType, string LinkURL)
        {
            StringBuilder TagStr = new StringBuilder();

            switch (FileType)
            {
            case "image/gif":
            case "image/bmp":
            case "image/pjpeg":
            {
                TagStr.Append("<a href=\"");
                TagStr.Append(ConfigHelper.GetConfigString("URL") + "\\FormAdHit.aspx?ADID=" + ADID);
                TagStr.Append("&LinkURL=" + LinkURL);
                TagStr.Append("\"");
                TagStr.Append(" target=\"_blank\">");
                TagStr.Append(" <IMG alt=\"" + desc + "\"");
                TagStr.Append(" src=\"" + filename + "\"");
                //					TagStr.Append(" width=\""+Width+"\" height=\""+High+"\" ");
                TagStr.Append(" border=\"0\">");
                TagStr.Append("</a>");
                break;
            }

            case "application/x-shockwave-flash":
            {
                TagStr.Append("<object ");
                //					TagStr.Append(" width="+Width+" height="+High+" ");
                TagStr.Append("  classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"  ");
                TagStr.Append(" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\"> ");
                //					TagStr.Append(" <param name=\"movie\" value=\""+filename+"?clickthru=");
                //					TagStr.Append("FormAdHit.aspx?ADID="+ADID);
                //					TagStr.Append("_LinkURL="+LinkURL);
                //					TagStr.Append("\"> ");
                TagStr.Append(" <param name=\"wmode\" value=\"opaque\"> ");
                TagStr.Append(" <param name=\"quality\" value=\"autohigh\"> ");
                TagStr.Append(" <embed  ");
                //					TagStr.Append(" width="+Width+" height="+High+"  ");
                TagStr.Append(" src=\"" + filename + "?clickthru=");
                TagStr.Append(ConfigHelper.GetConfigString("URL") + "\\FormAdHit.aspx?ADID=" + ADID);
                TagStr.Append("_LinkURL=" + LinkURL);
                TagStr.Append("\"  ");
                TagStr.Append(" quality=\"autohigh\" wmode=\"opaque\" type=\"application/x-shockwave-flash\"  ");
                TagStr.Append(" plugspace=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"> ");
                TagStr.Append(" </embed></object> ");
            }

            break;

            case "video/x-ms-wmv":
            case "video/mpeg":
            case "video/x-ms-asf":
            case "video/avi":
            case "audio/mpeg":
            case "audio/mid":
            case "audio/wav":
            case "audio/x-ms-wma":
                TagStr.Append("<embed");
                TagStr.Append(" src=\"" + filename + "\" border=\"0\" ");
                //					TagStr.Append(" width=\""+Width+"\" height=\""+High+"\"");
                TagStr.Append(" autoStart=\"1\" playCount=\"0\" enableContextMenu=\"0\"");
                TagStr.Append(" type=\"application/x-mplayer2\"></embed>");


                break;

            default:
                break;
            }

            return(TagStr.ToString());
        }
Esempio n. 2
0
        /// <summary>
        /// 创建显示图像的标签(flash无点击)
        /// </summary>
        public static string CreateTag2(string ADID, string filename, string desc, string FileType, string LinkURL, int Width, int High)
        {
            StringBuilder TagStr = new StringBuilder();

            switch (FileType)
            {
            case "image/gif":
            case "image/bmp":
            case "image/pjpeg":
            {
                TagStr.Append("<a href=\"");
                TagStr.Append(ConfigHelper.GetConfigString("URL") + "\\FormAdHit.aspx?ADID=" + ADID);
                TagStr.Append("&LinkURL=" + LinkURL);
                TagStr.Append("\"");
                TagStr.Append(" target=\"_blank\">");
                TagStr.Append(" <IMG alt=\"" + desc + "\"");
                TagStr.Append(" src=\"" + filename + "\"");
                TagStr.Append(" width=\"" + Width + "\" height=\"" + High + "\" ");
                TagStr.Append(" border=\"0\">");
                TagStr.Append("</a>");
                break;
            }

            case "application/x-shockwave-flash":
            {
                //					TagStr.Append("<a href=\"");
                //					TagStr.Append(LinkURL);
                //					TagStr.Append("FormAdHit.aspx?ADID="+ADID);
                //					TagStr.Append("&LinkURL="+LinkURL);
                //					TagStr.Append("\"");
                //					TagStr.Append(" target=\"_blank\">");

                TagStr.Append(" <embed src=\"" + filename + "\" ");
                TagStr.Append(" quality=\"high\" bgcolor=\"#f5f5f5\" ");
                TagStr.Append(" ></embed>");

                //					TagStr.Append("</a>");
            }

            break;

            case "video/x-ms-wmv":
            case "video/mpeg":
            case "video/x-ms-asf":
            case "video/avi":
            case "audio/mpeg":
            case "audio/mid":
            case "audio/wav":
            case "audio/x-ms-wma":

                //					TagStr.Append("<a href=\"");
                //					TagStr.Append(LinkURL);
                //					TagStr.Append("FormAdHit.aspx?ADID="+ADID);
                //					TagStr.Append("&LinkURL="+LinkURL);
                //					TagStr.Append("\"");
                //					TagStr.Append(" target=\"_blank\">");
                TagStr.Append("<embed");
                TagStr.Append(" src=\"" + filename + "\" border=\"0\" ");
                TagStr.Append(" width=\"" + Width + "\" height=\"" + High + "\"");
                TagStr.Append(" autoStart=\"1\" playCount=\"0\" enableContextMenu=\"0\"");
                TagStr.Append(" type=\"application/x-mplayer2\"></embed>");
                //					TagStr.Append("</a>");


                break;

            default:
                //					TagStr.Append("不允许该格式文件显示!");
                break;
            }

            return(TagStr.ToString());
        }