Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

how to convert "~/xxx" to AbsoluteUri ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jiatiejun - 27 Jul 2007 09:26 GMT
I want to convert a path from ~/xxx/xxx.gif to 'http://xxxxxxx/xxx/xxx.gif'

how to convert it?

thanks

btw:

the convert function allow
   1. '~/xxx/xxx.gif'
   2. 'xxx/xxx.gif'
   3. '/xxx/xxx.gif'
   4. 'http://xxxxxxx/xxx/xxx.gif'

to
   'http://xxxxxxx/xxx/xxx.gif' fotmat

how to do ?

tkanks

help
Vipper - 27 Jul 2007 10:20 GMT
Hi jiatiejun,

I suggest you read this web:

http://www.awprofessional.com/articles/article.asp?p=101145&seqNum=1

Hope this helps.

> I want to convert a path from ~/xxx/xxx.gif to 'http://xxxxxxx/xxx/xxx.gif'
>
[quoted text clipped - 18 lines]
>
> help
Cowboy (Gregory A. Beamer) - 27 Jul 2007 14:40 GMT
The method is found inside images controls, and the like. If you need to
dupe this, I would grab Reflector and "reverse engineer" the bits in
question so you can get the methodology down. This will solve the ~. You
will have to add the rest.

If you want to trudge through this, it is a matter of pulling the URL for
the site and getting the root portion and adding the rest of of the image
path.

I am not sure you really want to create a convert that accepts any sort of
garbage, like 'xxx/xxx.gif', but your mileage may vary. :-)

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************

>I want to convert a path from ~/xxx/xxx.gif to 'http://xxxxxxx/xxx/xxx.gif'
>
[quoted text clipped - 18 lines]
>
> help
Mythran - 27 Jul 2007 17:11 GMT
> The method is found inside images controls, and the like. If you need to
> dupe this, I would grab Reflector and "reverse engineer" the bits in
[quoted text clipped - 7 lines]
> I am not sure you really want to create a convert that accepts any sort of
> garbage, like 'xxx/xxx.gif', but your mileage may vary. :-)

How is 'xxx/xxx.gif' garbage?   It is just stating that the file 'xxx.gif'
is located in the 'xxx' sub-directory of the current directory.  Also, if
you are doing this in a web control, or web page, you can use the ResolveURL
method which will take care of the tilde '~' and the rest to resolve the URL
into the full URL....(I believe it is a protected method on the Control
class, IIRC).

HTH,
Mythran
Cowboy (Gregory A. Beamer) - 27 Jul 2007 17:29 GMT
Garbage is probably improper wording.

Most likely, you are providing this functionality for developers. If so, why
do they need many different formats that they can put a dynamic string into?
The more you support, the more likely you are going to have errors.

If for users, you can format the string when it comes in. And, then you only
need to support one format.

One thing we developers often do is make a system so flexible, for the user
(dev or end user) that we end up making the system harder to maintain and
often harder to understand.

Looking back at my comment, I was a bit harsh on that one, as there may be a
legitimate reason for supporting all of the options. I still think that too
many options opens an application up for errors, much like scoping
variables/routines at too high a level.

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************

>
>> The method is found inside images controls, and the like. If you need to
[quoted text clipped - 18 lines]
> HTH,
> Mythran

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.