C
C#2y ago
Lewis C

❔ Reusing strings across classes

This is file 1 https://cdn.discordapp.com/attachments/987310138195054592/1067462232860004433/image0.jpg I’d like to store and using the string content in other classes Like this https://cdn.discordapp.com/attachments/987310138195054592/1067462409738010634/image0.jpg But I have the red line of doom. What am I doing wrong
7 Replies
TheRanger
TheRanger2y ago
what does the error message say
Angius
Angius2y ago
OneFileAuth doesn't have any content Not a field Not a property Not a method
TheRanger
TheRanger2y ago
it could be non static too
Lewis C
Lewis C2y ago
Do I need to store the string another way It doesn’t contain a definition for “content”
Angius
Angius2y ago
Because it doesn't content is a local variable inside of your Main method
Lewis C
Lewis C2y ago
Ah so it suggested adding “internal static string content” above the main
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ UWP TreeView is not stretching to fill spaceTitle pretty much explains it all: I have a TreeView that's not stretching and stays 0px x 0px if t❔ Is there an easy way to serialize a Dictionary<string, string> to XML nodes?I'm writing a program that has to produce the following XML: ```xml <Attributes> <Color>red</Col✅ Could not load file or assembly 'StackExchange.RedisWhat causes these errors? How do I fix it? The project builds find on my windows machine. But runnin❔ Async function seems to continue running after returning.Hi there I'm doing a post request to a REST API. I can see that the callback is running in the conso❔ best way to include and works with imagesI'm working on a project, and I'll have to work with several images. Actually the project is working✅ how does compiler connect several c# codes into 1?I've noticed that classes that i created in other file are accessible in the main class (all in 1 pr❔ DMZ Server SoftwareI am working on a project to create a DMZ Server that will pass information to a 3rd party from the ✅ How to correctly install dependencies with nuget and rider ?Hi! project complains about missing dependencies, I installed dependencies but it still complains ,❔ How can I avoid supplying redundant generic type arguments in this case.```interface IDataStructure<ItemType, LocatorType> {...} Class MyStringArray: IDataStructure<string✅ Hello, what is best practice for where to store an enum type?What is best practice for where to store an enum type(Which class library)? I have clean architectur