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

  • Home
  • SEARCH
  • 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 6599233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:27:49+00:00 2026-05-25T18:27:49+00:00

My below code worked fine while running in .NET 4.0 but when I run

  • 0

My below code worked fine while running in .NET 4.0 but when I run the same code in .NET 2.0 I am getting an error at var I found that var is not accepted in .NET 2.0 and older but my Plesk 9.0.1 do not allow me to use .NET 4.0 also I cannot upgrade my plesk at this time because of traffic to my server. Well, anybody please convert the below code such that is works even with .NET 2.0. Thanks in advance.

        var app = new hMailServer.Application();
        app.Authenticate("Administrator", "********");
        var domain = app.Domains.get_ItemByName("mydomain.ext");
        var account = domain.Accounts.Add();
        account.Address = "user@mydomain.ext";
        account.Password = "secret";
        account.Active = true;
        account.MaxSize = 1000;
        account.PersonFirstName = "";
        account.Save();

Just instead of var what can I use? I tried string which is not accepted. Any idea?

First line I used as hMailServer.Application app = new hMailServer.Application(); Its accepted bur at the var domain and var account .NET 2.0 is not accepting.

  • 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-05-25T18:27:49+00:00Added an answer on May 25, 2026 at 6:27 pm

    Just instead of var what can I use?

    Use the actual types (read the documentation of the API you are using to understand what those types are):

    hMailServer.Application app = new hMailServer.Application();
    app.Authenticate("Administrator", "********");
    hMailServer.Domain domain = app.Domains.get_ItemByName("mydomain.ext");
    hMailServer.Account account = domain.Accounts.Add();
    ...
    

    Also note that var was introduced in C# 3.0 and not 4.0.

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

Sidebar

Related Questions

hi i have a function that worked fine using jQuery 1.3.2 but now i
The code below worked fine until I added the regex line. When I comment
When running the below code a type is never returned, despite there being a
Code below does not run correctly and throws InvalidOperationExcepiton . public void Foo() {
The code below shows a sample that I've used recently to explain the different
For a while now the installer for my program has used the below code
Here is the code below I tried this call but it didnt work... even
My MVC application has worked fine for over a year, but it has now
I've been using FB Connect for some time now. The code below has worked
I worked on a JSP code that is runnning on a Tomcat5.5 server in

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.