CPropertySheet创建和参数的添加都是正确的,可不知为什么公司那破电脑老是把图片显示为右上角一个小黑框,header其他地方都是白色背景。求高人赐教!!

解决方案 »

  1.   

    //排版soap报文
    String strTmp =  new String((byMsgs));

    int iTmp = 0;
    int iCount = 0;

    //找'<'的数量
    while(true)
    {
    iTmp = strTmp.indexOf('<', iTmp);
    if( -1 == iTmp)
    {
    break;
    }
    if( -1 == iTmp)
    {
    break;
    }
    iTmp++;
    iCount++;
    }

    //'<'前面添加一个换行符
    if( 0 != iCount )
    {
    iTmp = 0;
    for(int i=0;i<iCount;i++)
    {
    iTmp = strTmp.indexOf('<', iTmp);
    if( -1 == iTmp)
    {
    break;
    }
    if( i == 0)
    {
    //xml头就不换行了
    iTmp++;
    continue;
    }
    strTmp = strTmp.substring(0, iTmp) + "\n" + strTmp.substring(iTmp);
    iTmp += 2;
    }
    }

    iCount = 0;
    //找'</'和'/>'的数量
    iTmp = 0;
    while(true)
    {
    iTmp = strTmp.indexOf("</", iTmp);
    if( -1 == iTmp)
    {
    break;
    }
    iTmp++;
    iCount++;
    }
    iTmp = 0;
    while(true)
    {
    iTmp = strTmp.indexOf("/>", iTmp);
    if( -1 == iTmp)
    {
    break;
    }
    iTmp++;
    iCount++;
    }

    //"</"和"<"前面添加
    if( 0 != iCount )
    {
    String strTab = new String("");
    iTmp = strTmp.indexOf("<?", 0);
    for(int i=0;i<iCount;i++)
    {
    if( -1 == iTmp)
    {
    break;
    }
    iTmp++;
    iTmp = strTmp.indexOf('<', iTmp);
    if( -1 == iTmp)
    {
    break;
    }
    if( i == 0)
    {
    //第一个"<"不加
    iTmp++;
    continue;
    }
    strTab = "";
    for(int j=i-1;j>=0;j--)
    {
    strTab += "   ";
    }
    strTmp = strTmp.substring(0, iTmp) + strTab + strTmp.substring(iTmp);
    iTmp += (strTab.length() + 1);
    }

    iTmp = strTmp.length()-1;
    for(int i=0;i<iCount;i++)
    {
    iTmp = strTmp.lastIndexOf("</", iTmp);
    if( -1 == iTmp)
    {
    break;
    }
    if( i == 0)
    {
    //倒数第一个"</"不加
    iTmp--;
    continue;
    }
    strTab = "";
    for(int j=i-1;j>=0;j--)
    {
    strTab += "   ";
    }
    strTmp = strTmp.substring(0, iTmp) + strTab + strTmp.substring(iTmp);
    iTmp = iTmp - (strTab.length() - 1);
    }
    }