website - C# Read ini value from url -


i have site example "http://example.com" , here settings.ini file "http://example.com/settings.ini" , in file wrriten text:

[client] enabled=1 

i wan't give value c#, possible, how to?

for example i'm using code:

var myini = new inifile(@"c:\settings.ini"); var defaultvolume = myini.read("enabled"); messagebox.show(defaultvolume); 

it works good, i'm trying make this:

var myini = new inifile(@"http://example.com/settings.ini"); 

but not work, thanks.

edit:

i'm getting error:

an unhandled exception of type "system.argumentexception" in mscorlib.dll more information: uri formats not supported. 

updated:

this code gets value .ini, need integrate old code

webclient client = new webclient(); stream stream = client.openread("http://example.com/settings.ini"); streamreader reader = new streamreader(stream); string content = reader.readtoend(); 

read ini file content httpwebrequest (http://www.csharp-station.com/howto/httpwebfetch.aspx)


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -