Re: [C#] URI behaving badly
I don't really know C# at all, but I did some searching around.
PHP Code:
String NewsPageNavigation = "http://" + Configuration.IPaddress + "/" + Configuration.Newspage;
Uri myUri = new Uri(NewsPageNavigation);
WebRequest wr = WebRequest.Create(myUri);
Just taking a shot in the dark here, but your syntax doesn't match too well with other references I found. Maybe you can pick apart something and make it work..
http://msdn.microsoft.com/en-us/library/system.uri.aspx
Re: [C#] URI behaving badly
Thanks for trying, but still no good. I'm getting the same error as the other way I was doing it
Error:
Code:
System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at flyff_patcher.MainWindow..ctor() in X:\Useers\Myusername\Documents\Visual Studio 2010\Projects\flyff_patcher\flyff_patcher\MainWindow.xaml.cs:line 38
I forgot to mention why I was using NavigationService() lol. I coded the interface in XAML, and the guide I was reading about XAML frames said to use NavigationService() to load a webiste inside of the frame.
Re: [C#] URI behaving badly
Have you tried these?
http://msdn.microsoft.com/en-us/library/ms591051.aspx
(example of use)
Quote:
Originally Posted by .NET Framework Developer Center
void goObjectButton_Click(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new ContentPage());
}
To replace "ContentPage()"..?
http://msdn.microsoft.com/en-us/libr...rols.page.aspx
Re: [C#] URI behaving badly
The following code works ok:
Code:
string address = "localhost";
string file = "news.php";
string fullAddress = "http://" + address + "/" + file;
Uri testURI = new Uri(fullAddress);
Console.WriteLine("Successfully created Uri object for: " + testURI.AbsoluteUri);
Console.ReadKey();
are you sure that Configuration.IPaddress is populated with value at the moment when you use it to create address?
Add it to watchlist and set a breakpoint at that line or add something like Console.WriteLine(Configuration.IPaddress) below or above that line and look what it will produce.
Re: [C#] URI behaving badly
Why don't you do the following:
On the website, make a file called latestversion.v.
In that, type in the latest version (Ex, 5).
Now, use WebClient to connect to that page and download the content
(which would be the version you typed in; (Ex. 5))
Then, get the version of the current client, and if its older, download the new file, by using WebClient to download the content of the EXE and renaming it to an exe.
Example:
The latest client is located at web.tld/new.exe
Use WebClient to download new.exe, then rename the resulting file to client.exe (or whatever)
You could do something with updating certain parts of the file to make the update faster, but that's advanced stuff.