tags:

views:

31

answers:

1

I have a file that lies on the path http://www.site.ru/config.ini

And there is someone else's code that takes a file that should be on the computer (locally).

You can of course save the file, and then pass, but I can not save the file locally (which would not be who could not work with it).

Function:

[DllImport ("kernel32")]
        private static extern int GetPrivateProfileString (string section, string key, string def, StringBuilder retVal, int size, string filePath);

What shall I do?

+2  A: 

maybe downloading the file to a stream via http might be helpful.

I found an example on how to do this on csharpfriends.com:

public form1()
{
    InitializeComponent();

    System.Net.WebClient Client = new WebClient();
    Stream strm = Client.OpenRead("http://www.csharpfriends.com");
    StreamReader sr = new StreamReader(strm);
    string line;
    do
    {
        line = sr.ReadLine();
        listbox1.Items.Add(line);
    }
    while (line !=null);
    strm.Close();
}
sum1stolemyname
but i not give file.
simply denis
Do you mean you can't write a file on the machine running your program?
sum1stolemyname