Click here to Skip to main content
16,010,268 members
Home / Discussions / Mobile
   

Mobile

 
Questionfind a resource type Pin
Jim Crafton24-Jun-08 8:54
Jim Crafton24-Jun-08 8:54 
QuestionChecking if a application works with CE Pin
Michael Bookatz23-Jun-08 8:02
Michael Bookatz23-Jun-08 8:02 
AnswerRe: Checking if a application works with CE Pin
Spacix One24-Jun-08 8:43
Spacix One24-Jun-08 8:43 
GeneralRe: Checking if a application works with CE Pin
Michael Bookatz24-Jun-08 23:28
Michael Bookatz24-Jun-08 23:28 
Questionfind the size of download data... Pin
PavanPareta23-Jun-08 2:26
PavanPareta23-Jun-08 2:26 
AnswerRe: find the size of download data... Pin
Arjun Marwaha23-Jun-08 19:26
Arjun Marwaha23-Jun-08 19:26 
Questionfind out Network Connetion Pin
PavanPareta23-Jun-08 1:51
PavanPareta23-Jun-08 1:51 
QuestionBuilding a System.Uri with a query string Pin
Spacix One19-Jun-08 13:04
Spacix One19-Jun-08 13:04 
please note: Yes I already posted this in the C# forum ( http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2604582[^] ), but at the suggestion of others said I might have better luck here.
I give up, this seems impossible without the UriBuilder class... Well since .NET 1.1 when they made Uri(string, bool) obsolete... So here is my question:

How do you build a System.Uri object in .NET compact framework that points to a "file://" scheme with passed query information?

I've tried every valid (not obsolete) constructor for System.Uri meaning:

* Uri(string)
* Uri(string, UriKind)
* Uri(base, string)
* Uri(Uri, Uri)

It didn't matter which I use because they don't have any affect on the outcome... Every constructor will escape the ? to hex as %3F which is not valid to use with query information!!!

I can do this fine with strings but if I pass a string to the WebBrowser control it'll convert the string to a Uri object and have the problem again. So I need to build the correct Uri object and pass it to the WebBrowser control.

MSDN says the following lie:
The Uri constructors do not escape URI strings if the string is a well-formed URI including a scheme identifier.


Proven by this example:(start a new smart device application and add this code to the form1.cs file)
using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Text; 
using System.Windows.Forms; 
 
namespace DeviceApplication1 
{ 
    public partial class Form1 : Form 
    { 
        public int demoValue = 4; 
        public Form1() 
        { 
            InitializeComponent(); 
            this.Load += new EventHandler(this.Form1_Load); 
        } 
 
        void Form1_Load(object sender, EventArgs e) 
        { 
            Uri htmlFile = new Uri(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), UriKind.Absolute); 
            MessageBox.Show("htmlFile.AbsoluteUri=\r\n" + htmlFile.AbsoluteUri); //show how the path is converted correctly into a uri string with a correct scheme 
            string properFormated = string.Format("{0}/DeviceApplication1/test.html?test={1}", htmlFile.AbsoluteUri, this.demoValue); 
            MessageBox.Show("properFormated=\r\n" + properFormated); //show the string is properly formated and escaped correctly! 
            Uri fileWithQuery = new Uri(properFormated); 
            MessageBox.Show("fileWithQuery.PathAndQuery=\r\n" + fileWithQuery.PathAndQuery); //show the error in the Uri not accepting the query content 
        } 
    } 
}


View your results and see my problem Frown | :( any suggestions? I'm desprate at the moment (this has been bothering me since April!)


-Spacix
All your skynet questions[^] belong to solved

I dislike the black-and-white voting system on questions/answers. Dead | X|

AnswerRe: Building a System.Uri with a query string Pin
Spacix One23-Jun-08 7:20
Spacix One23-Jun-08 7:20 
Questionauto internet connection Pin
trubarr19-Jun-08 11:05
trubarr19-Jun-08 11:05 
QuestionWinCE Database Pin
iayd19-Jun-08 4:21
iayd19-Jun-08 4:21 
Questionhow to generate a call in PBX Manager & Console Asterisk in windows Pin
waseemakhtar18-Jun-08 23:55
waseemakhtar18-Jun-08 23:55 
Questionwindows mobile 5 with auto keypad program Pin
Newbie_Toy18-Jun-08 18:25
Newbie_Toy18-Jun-08 18:25 
Question.NET Compact Framework 6.0 - Integration with VS 2005 Pin
scottdj18-Jun-08 9:01
scottdj18-Jun-08 9:01 
AnswerRe: .NET Compact Framework 6.0 - Integration with VS 2005 Pin
Spacix One20-Jun-08 2:18
Spacix One20-Jun-08 2:18 
GeneralRe: .NET Compact Framework 6.0 - Integration with VS 2005 Pin
scottdj20-Jun-08 8:28
scottdj20-Jun-08 8:28 
GeneralRe: .NET Compact Framework 6.0 - Integration with VS 2005 Pin
Spacix One20-Jun-08 8:58
Spacix One20-Jun-08 8:58 
QuestionWant to get know how to develop an application which can play a video on Pocket 2003 platform Pin
whiteclouds16-Jun-08 17:42
whiteclouds16-Jun-08 17:42 
QuestionPrinting Text in Smart device Pin
Dushan12315-Jun-08 20:12
Dushan12315-Jun-08 20:12 
QuestionModal dialog box in thread Pin
iayd13-Jun-08 5:17
iayd13-Jun-08 5:17 
QuestionConnect Device emulator to network Pin
Dushan12311-Jun-08 19:19
Dushan12311-Jun-08 19:19 
AnswerRe: Connect Device emulator to network Pin
Arjun Marwaha15-Jun-08 20:11
Arjun Marwaha15-Jun-08 20:11 
GeneralRe: Connect Device emulator to network Pin
Spacix One19-Jun-08 13:07
Spacix One19-Jun-08 13:07 
QuestionConverting German Character 'ß' using codepage 850 Pin
Tushar Mahajan11-Jun-08 3:36
Tushar Mahajan11-Jun-08 3:36 
AnswerRe: Converting German Character 'ß' using codepage 850 Pin
KarstenK11-Jun-08 3:44
mveKarstenK11-Jun-08 3:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.