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 8806827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:13:22+00:00 2026-06-14T02:13:22+00:00

i have one main class and with in this main class i have another

  • 0

i have one main class and with in this main class i have another class A. class A has few static property and when i tried to access those static property from outside but getting error….not being possible

here is my classes structure

 public class EShip
{
    class Credentials
    {
        private static string _accessKey = "aaa";
        private static string _accessPwd = "xxx";
        private static string _accountNumber = "2222";

        public static string AccessKey
        {
            get { return _accessKey; }
        }

        public static string AccessPassword
        {
            get { return _accessPwd; }
        }

        public static string AccountNumber
        {
            get { return _accountNumber; }
        }
    }

    public static Credentials Credential
    {
        { get; }
    }
}

i try to expose that inner class by a main class property and from outside i try to do like

EShip.Credentials.AccessKey
EShip.Credentials.AccessPassword

it is not getting possible……suggest me good approach and why i am stuck. thnx.

  • 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-06-14T02:13:24+00:00Added an answer on June 14, 2026 at 2:13 am

    Class Credentials is not public, therefore it’s not accessible. Change that and you’re able to do:

    String key = EShip.Credentials.AccessKey;
    

    Access Modifiers (C# Programming Guide)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one main class with several inherited members who all overload the same
I have one main project and another project which is added as a subprojects.
I have one main array which is the returned data from a MySQL query
I have a design of activities like this I have one main activity and
This is my problem, I have the main view which only shows one button,
Let's say I have a class A and this class has a List l
I have two activities, one is main and I have another activity called Test
I have WPF application with one main window . In this window there are
This topic has been covered in one form or another but none of the
I have an entity class, correctly defined in a managed context. This class has

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.