Access the configuration file. program. getconfigvalue (string, string) ": not all code paths return values.

Source: Internet
Author: User

I am doing a small test of accessing the configuration file data in C #, but when I perform breakpoint debugging During writing, I always prompt: "access the configuration file. program. getconfigvalue (string, string) ": not allCodePath return value ". In drive D, the breakpoint is placed in the ending brackets of foreach. Below is the code, please give me more advice

Using system;
Using system. Collections. Generic;
Using system. LINQ;
Using system. text;

Access the configuration file using namespace
{
Class Program
{
Static void main (string [] ARGs)
{
}
Static string getconfigvalue (string filename, string itemname)
{
String [] lines = system. Io. file. readalllines (@ "D:/2.ini", encoding. Default );

Foreach (string STRs in lines)
{
String [] STR = STRs. Split ('= ');

}

}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.