Error Cs1012 Too Many Characters
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss too many characters in character literal aspx the workings and policies of this site About Us Learn more too many characters in character literal java about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow too many characters in character literal c# split Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
Too Many Characters In Character Literal Javascript
each other. Join them; it only takes a minute: Sign up Why I'm getting CS1012: “Too many characters in character literal” and CS0019? up vote 15 down vote favorite When trying to upload something to Imgur, I have to put an Authorization in. I do it with WebRequest.Headers but it gives me three errors. 2 times CS1012 error too many characters in character literal c# string Too many characters in character literal and 1 time CS0019 error: Operator '+' cannot be applied to operands of type 'char' and 'method group' This is the code: webRequest.Headers['Authorization'] = 'Bearer ' + GetToken; What have I done wrong, how can I fix it, and how does it work? This is uploading with Imgur, I don't know if the 'GetToken' thing is right but it's to get the AccessToken, which should work correctly if I'm right. c# imgur share|improve this question edited Dec 15 '13 at 21:55 Alexei Levenkov 71.1k55398 asked Dec 15 '13 at 21:45 Stepepper 3581616 add a comment| 1 Answer 1 active oldest votes up vote 47 down vote accepted You're trying to use single quotes for string literals - that's invalid in C#. Single quotes are for character literals (char). You need double quotes for string literals. You also need parentheses for a method call: webRequest.Headers["Authorization"] = "Bearer " + GetToken(); (Note that this has nothing to do with imgur or WebRequest - it's just normal C#.) Li
here for a quick overview of the site Help Center Detailed answers to any questions you might have too many characters in character literal android Meta Discuss the workings and policies of this site About Us
Too Many Characters In Character Literal Html
Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with
Cs1012 Too Many Characters In Character Literal Javascript
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, http://stackoverflow.com/questions/20600191/why-im-getting-cs1012-too-many-characters-in-character-literal-and-cs0019 just like you, helping each other. Join them; it only takes a minute: Sign up Too many characters in character literal what is the error up vote 2 down vote favorite Server Error in '/Purchase Order' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review http://stackoverflow.com/questions/21379214/too-many-characters-in-character-literal-what-is-the-error the following specific error details and modify your source code appropriately. Compiler Error Message: CS1012: Too many characters in character literal Source Error: Line 212:
Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog quick answersQ&A Ask a Question View http://www.codeproject.com/Questions/716466/Too-many-characters-in-character-literal Unanswered Questions View All Questions... C# questions Linux questions ASP.NET questions SQL questions VB.NET questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin too many Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The too many characters Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question All Questions All Unanswered FAQ Too many characters in character literal Rate this: Please Sign up or sign in to vote. See more: C# ASP.NET CSS SQL Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1012: Too many characters in character literal Source Error: Line 212: