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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:38:47+00:00 2026-06-09T22:38:47+00:00

I’m relatively new to C# coding in the .NET framework. I’m using Visual studios

  • 0

I’m relatively new to C# coding in the .NET framework. I’m using Visual studios 10.
I feel like this is a simple problem but whatever I seem to try with the visability, it doesn’t work. This is the “try” with the least errors. I wanted to split the classes to be separate from the windows application form code. Maybe that’s why it isn’t working properly as when I ran a first try all in one (messy) windows app form code, it worked. Now splitting it into a neater package it won’t. Please take a look at the code and tell me what I’m overlooking. I have searched the questions of course as well as googling, but the problem is that mostly this error has to do with arrays.
For me it does NOT.

Here is the error:

‘adm_LogOn’ is a ‘variable’ but is used like a ‘method’ DemoTestEditor\DemoTestEditor\Form1.cs

  private void buttonAdmLogOn_Click(object sender, EventArgs e)
    {
        //  The console commands (above and below Writes to the Output. 
        //  Messagebox also works but I think it's too "in your face"

        Console.WriteLine("Admin Log On Button pressed.");

        AdminClasses adm_LogOn = new AdminClasses(); // Creates a new object instance myALogOn

        this.admTicket = adm_LogOn(userName.Text, passWord.Text);
        if (this.admTicket != null)
        {
            Console.WriteLine("Got Ticket: " + this.admTicket);
            this.buttonAdmLogOn.Enabled = true;
            this.buttonAdmLogOff.Enabled = false;
        }
    }

And this is the class it’s calling within the separate Admin.classes.cs code.

    public string adm_LogOn(string username, string password)
    {
        // Initialize a (new object) adm service to work with.
        SmartConnectionAdmin.SmartConnectionAdminService adm = new SmartConnectionAdmin.SmartConnectionAdminService();

        // Setting up the arguments for the webservice (LogOnRequest) parameters
        string ticket = null;
        string server = null;
        string clientName = "C# Client Suus";
        string domain = null;
        string clientAppName = "C# Tester Suus";
        string clientAppVersion = null;
        string clientAppSerial = null;
        string clientAppCode = null;

        try
        {
            // Place call with the above arguments
            adm.LogOn(username, password, ref ticket, server, clientName, domain, clientAppName, clientAppVersion, clientAppSerial, clientAppCode);

            // Displays the retrieved ticket
            Console.WriteLine("The following ticket has been received: {0}", ticket);

        }
        catch (Exception e)
        {
            MessageBox.Show("Error: " + e.Message, "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Error);

        } 

        Console.WriteLine("UserName checked.");

        return ticket;
    }
}
  • 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-09T22:38:49+00:00Added an answer on June 9, 2026 at 10:38 pm

    public string adm_LogOn(string username, string password) isn’t a class definition, it is a method (within a class). You will need to create the surrounding object if it doesn’t exist, then you can jsut call this method from the instance of that class.

    If this method is within the class you are currently using, you can just call the method, i.e. you can remove this line:

    AdminClasses adm_LogOn = new AdminClasses(); 
    

    What you need to do is change it to this:

    AdminClasses admClass = new AdminClasses(); // Creates a new object instance myALogOn 
    
    this.admTicket = admClass.adm_LogOn(userName.Text, passWord.Text); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.