[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to acess the folder ClientBin/XML (UriKind.Relative)

Posted on 2011-03-24
2
Medium Priority
?
815 Views
Last Modified: 2013-11-12
I trying to acess the folder ClientBin/XML and I´m not getting.
      private void XML_Click(object sender, RoutedEventArgs e)
        {
            WebClient client = new WebClient();
            string _Uri = "/XML/file.xml"; >>>>>>>>> THIS NOT WORKS
            Uri uritoXML = new Uri(_Uri, UriKind.Relative);
            client.OpenReadCompleted += new OpenReadCompletedEventHandler(XML_Click_Final1);
            client.OpenReadAsync(uritoXML);
        }

I can acess the folder ClientBin.
      private void XML_Click(object sender, RoutedEventArgs e)
        {
            WebClient client = new WebClient();
            string _Uri = "file.xml"; >>>>>>>>> THIS WORKS
            Uri uritoXML = new Uri(_Uri, UriKind.Relative);
            client.OpenReadCompleted += new OpenReadCompletedEventHandler(XML_Click_Final1);
            client.OpenReadAsync(uritoXML);
        }

I can acess too by site
      private void XML_Click(object sender, RoutedEventArgs e)
        {
            WebClient client = new WebClient();
            string _Uri = @"http://mysite.com.br/ClientBin/XML/file.xml"; >>>>>>>>> THIS WORKS
            Uri uritoXML = new Uri(_Uri, UriKind.Absolute);
            client.OpenReadCompleted += new OpenReadCompletedEventHandler(XML_Click_Final1);
            client.OpenReadAsync(uritoXML);
        }

what is wrong in the first case?


Thanks

0
Comment
Question by:Plexo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Expert Comment

by:politex
ID: 35212919
Hi, can be two variants, path must be "/ClientBin/XML/file.xml" or you have not grant access for clients to this folder
0
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 2000 total points
ID: 35213144
private void XML_Click(object sender, RoutedEventArgs e)
        {
            WebClient client = new WebClient();
            string _Uri = "XML/file.xml";
            Uri uritoXML = new Uri(_Uri, UriKind.RelativeOrAbsolute);
            client.OpenReadCompleted += new OpenReadCompletedEventHandler(XML_Click_Final1);
            client.OpenReadAsync(uritoXML);
        }
changes i made are in bold

this shud work if the actual folder stucture is "ClientBin - > Xml -> file.xml"
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question