What are the rules for using \ or /

A

AAaron123

What are the rules for using \ or /

In a .vb file it appears I can intermix them. They appear to be equal.

Is that true.

What do you use in .vb files?



But in an .aspx file I'm not sure.

I bombed once using FireFox, changed \ to / and then it ran OK.

Not sure if that was what caused the problem.

What do you use in .aspx files?



Are there rules I can follow to stay out of trouble?





Thanks
 
G

Gregory A. Beamer

What are the rules for using \ or /

In a .vb file it appears I can intermix them. They appear to be equal.

Is that true.

What do you use in .vb files?


\ is a DOS path, inlcluding UNC
/ is a virtual path, which is used in URLs and other 'net paths

BTW, just because VB fixes things for you does not mean you should be
sloppy. ;-)

Examples:

c:\mypath\mydoc.txt - file path

file://c:\mypath\mydoc.txt - file path qualified to distinguish from
other virtual paths

http://www.mywebsite.com/file.txt - web path

etc.

Peace and Grace,
 
A

AAaron123

Gregory said:
\ is a DOS path, inlcluding UNC
/ is a virtual path, which is used in URLs and other 'net paths

BTW, just because VB fixes things for you does not mean you should be
sloppy. ;-)
That why I'm asking.

thanks
 
A

AAaron123

<%@ Page Language="VB" MasterPageFile="~/Main.master"

<%@ WebService Language="VB" CodeBehind="~/App_Code/WebServiceGetSlides.vb"

<img src="../Albums/HttpHandlerSendImageD...



I can figure it out if it starts with ,say, C:/

or http"//

but the above appear to be file paths.

Are they correct?





Thanks
 
J

Juan T. Llibre

re:
!> the above appear to be file paths

They are virtual paths...

~/ identifies the virtual root directory of an ASP.NET web application.

<img src=... always refers to virtual paths on the server.
If <img src referred to a physical path, the image would have to reside in the user's hard drive.




===============
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top