dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Syntax Help - Convert C# to VB.NET

  1. #1
    Join Date
    Jun 2004
    Posts
    9

    Syntax Help - Convert C# to VB.NET

    Hi,

    I'm trying to convert the following method to VB.NET

    public static string get_setting(string name, string default_value) {

    NameValueCollection name_values
    = (NameValueCollection)ConfigurationSettings.GetConfig("btnetSettings");
    if (name_values[name] == null || name_values[name] == "")
    {
    return default_value;
    }
    else
    {
    return name_values[name];
    }
    }

    After I declare name_values

    I'm not sure how to handle this:

    name_values = (NameValueCollection)ConfigurationSettings.GetConfig("somekeyinWebConfig");

    Any ideas?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2004
    Posts
    9
    It's all good, I figured it out:

    name_values =CType(ConfigurationSettings.GetConfig("btnetSettings"), NameValueCollection)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles