Thank you again this time.
We are developing form applications that run locally in VisualStudio.
I stored string literals of about 5,000,000 characters in two patterns in two string type variables, respectively.
An error occurs during compilation. (Refer to the lower error text)
Please tell me how to avoid errors or alternatives.
This 5,000,000 character string is what was originally stored as a csv file and made into one line using a script.
By design, external files should not be referenced, so
I think that it is necessary to put this character string in exe.
The reason why you cannot refer to the external file is that I want to keep the contents of the csv file confidential.
Although it is an alternative that I thought of, it is as follows.
①Use the database
② Have csv file with zippass and unzip inside exe when referring
③ Place DataGritView in the main form with visible = Flase and store the data in it
I think that it is a project that should be adopted ①, but unfortunately there are few man-hours and a new DB
There is no time to learn related knowledge.
In addition, even if (2) is adopted, there is a possibility that the temporarily decompressed file may be placed somewhere during decompression, so it is inferior as a secret function.
If possible, it is desirable to avoid this error without changing the program already made.Error message
Supplemental information (FW/tool version etc.)
Error CS8103 The total length of user strings used in the program exceeds the allowed limit. Reduce the use of string literals.
Microsoft Visual Studio Community 2017
VisualStudio.15.Release/15.7.3 + 27703.2026
Microsoft .NET Framework
In the following, it is written that "String Object is 2GB or about 1 billion characters" can be stored.
In the following,
"I guess its a new compiler in VS2015, which restricts too much use of string literals."
"I think the new compiler in VS2015 is too restrictive to use string literals."
There is. Is there no help for the VS specification?
Answer # 1
The reason why you cannot refer to the external file is that you want to keep the contents of the csv file confidential.
In the first place, if you just write it as a string literal,it will be embedded in the executable file. The secret is whether it has an effect of comfort.
- c # - formatexception: input string was not in a correct format error in unity
- a method with a string as an argument in c #
- Django implement string literals and auto-escaping in templates
- c # - netcore30 cpu usage is abnormal
- c # i want to get all file paths that do not contain the specified string
- how to read character string from standard input one by one in c # and cast to string type and put in array
- c # - search for "]" in the string
- how to receive c # json string
- c # - i want to separate the go string
- c # - i want to separate the character string of string (regular expression)
- c # - i want to change the value read as a character string from a csv file to double type
- c # - how to specify the argument systemwindowsuielement as a string
- c # - b:about takahashi-kun and character string compression
- c # - about character string match judgment
- c # - systemformatexception the format of the input string is incorrect
- c # - typegettype how to represent a fully qualified class name using a string type variable as an argument
- i want to handle bitmap save path as string in c #
- i want to make c # string a float
- i want to convert a string that reads a c # csv file to a number
- [excel] i want to get the maximum value of a character string
- c # - get variable values from aspnet code-behind
- unable to add c # systemwindowsformsform
- c # - toolbox is not displayed even on the screen of visual studio design
- c # - it appears in the console window even though it is different from the condition of the unity if statement
- c # - i want to display my form as new after sleeping for a few seconds
- c # - i want to share variables from other scripts
- get audio in c # and display waveform
- c # - i want to specify a different url from the script side for the video player component of unity
- candidates are not displayed even if i hit a period in c # opened in unity
- how do i switch between multiple programs in visual studio c #?