Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 196555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:46:39+00:00 2026-05-11T16:46:39+00:00

I am adding some script using the StringBuilder. The script is as shown below.

  • 0

I am adding some script using the StringBuilder. The script is as shown below.

<script type='text/javascript'><!--    //<![CDATA[
    var m3_u = (location.protocol == 'https:' ? 'https://rre.rrt.com/sss.php' : 'https://rre.rrt.com/sss.php');
    var m3_r = Math.floor(Math.random() * 99965449);
    if (!document.MAX_used) document.MAX_used = ',';
    document.write("<scr" + "ipt type='text/javascript' src='" + m3_u);
    document.write("?zoneid=311120&amp;target=_top");
    document.write('&amp;cb=' + m3_r);
    if (document.MAX_used != ',') document.write("&amp;exclude=" + document.MAX_used);
    document.write(document.charset ? '&amp;charset=' + document.charset : (document.characterSet ? '&amp;charset=' + document.characterSet : ''));
    document.write("&amp;loc=" + escape(window.location));
    if (document.referrer) document.write("&amp;referer=" + escape(document.referrer));
    if (document.context) document.write("&context=" + escape(document.context));
    if (document.mmm_fo) document.write("&amp;mmm_fo=1");
    document.write("'><\/scr" + "ipt>");
//]]>-->
</script><noscript><a href='https://rre.rrt.com/sss.php?n=ad4565c1&amp;cb=2244' target='_top'><img src='https://rre.rrt.com/sss.php?zoneid=36540&amp;n=a535c1' border='0' alt='' /></a></noscript>

When I add this using String Builder, it gives error “Too many characters in character literal” This is how I am doing. How to do it?

sb.append(@"<script type='text/javascript'><!--    //<![CDATA[
    var m3_u = (location.protocol == 'https:' ? 'https://rre.rrt.com/sss.php' : 'https://rre.rrt.com/sss.php');
    var m3_r = Math.floor(Math.random() * 99965449);
    if (!document.MAX_used) document.MAX_used = ',';
    document.write("<scr" + "ipt type='text/javascript' src='" + m3_u);
    document.write("?zoneid=311120&amp;target=_top");
    document.write('&amp;cb=' + m3_r);
    if (document.MAX_used != ',') document.write("&amp;exclude=" + document.MAX_used);
    document.write(document.charset ? '&amp;charset=' + document.charset : (document.characterSet ? '&amp;charset=' + document.characterSet : ''));
    document.write("&amp;loc=" + escape(window.location));
    if (document.referrer) document.write("&amp;referer=" + escape(document.referrer));
    if (document.context) document.write("&context=" + escape(document.context));
    if (document.mmm_fo) document.write("&amp;mmm_fo=1");
    document.write("'><\/scr" + "ipt>");
//]]>-->
</script><noscript><a href='https://rre.rrt.com/sss.php?n=ad4565c1&amp;cb=2244' target='_top'><img src='https://rre.rrt.com/sss.php?zoneid=36540&amp;n=a535c1' border='0' alt='' /></a></noscript>

");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:46:39+00:00Added an answer on May 11, 2026 at 4:46 pm

    The whole point of using a StringBuilder is to build the string part by part. If you break up the long string into logical portions, then it becomes easier for you to figure out any errors as well as make modifications (and believe me, it becomes much easier to read!).

    Also, When using verbatim string literals in C#, you still need to escape double quotes with another double quote. The following code compiles correctly:

    sb.Append(@"<script type='text/javascript'>");
    sb.Append(@"<!--    //<![CDATA[");
    sb.Append(@"var m3_u = (location.protocol == 'https:' ? 'https://rre.rrt.com/sss.php' : 'https://rre.rrt.com/sss.php');");
    sb.Append(@"var m3_r = Math.floor(Math.random() * 99965449);");
    sb.Append(@"if (!document.MAX_used) document.MAX_used = ',';"");");
    sb.Append(@"document.write(""<script type='text/javascript' src='"" + m3_u);");
    sb.Append(@"document.write(""?zoneid=311120&amp;target=_top"");");
    sb.Append(@"document.write('&amp;cb=' + m3_r);");
    sb.Append(@"if (document.MAX_used != ',') document.write(""&amp;exclude="" + document.MAX_used);");
    sb.Append(@"document.write(document.charset ? '&amp;charset=' + document.charset : ");
    sb.Append(@"(document.characterSet ? '&amp;charset=' + document.characterSet : ''));");
    sb.Append(@"document.write(""&amp;loc="" + escape(window.location));");
    sb.Append(@"if (document.referrer) document.write(""&amp;referer="" + escape(document.referrer));");
    sb.Append(@"if (document.context) document.write(""&context="" + escape(document.context));");
    sb.Append(@"if (document.mmm_fo) document.write(""&amp;mmm_fo=1"");");
    sb.Append(@"document.write(""'><\/script>"");");
    sb.Append(@"//]]>-->");
    sb.Append(@"</script>");
    sb.Append(@"<noscript>");
    sb.Append(@"<a href='https://rre.rrt.com/sss.php?n=ad4565c1&amp;cb=2244' target='_top'>");
    sb.Append(@"<img src='https://rre.rrt.com/sss.php?zoneid=36540&amp;n=a535c1' border='0' alt='' /></a>");
    sb.Append(@"</noscript>");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 208k
  • Answers 208k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's not vulnerable as long as register_globals doesn't allow $allow… May 12, 2026 at 9:29 pm
  • Editorial Team
    Editorial Team added an answer I don't know what you're trying to do, but templates… May 12, 2026 at 9:29 pm
  • Editorial Team
    Editorial Team added an answer What is keeping me from writing into the memory location… May 12, 2026 at 9:29 pm

Related Questions

Can anyone help, I am using the following for adding a bookmark to IE
I am searching for records in a table as follows: SELECT Id, Name FROM
I am writing an algorithm to generate combinations of items from a database. They
I am creating a light RPG game where a character is able to equipment

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.