Click here to Skip to main content
15,887,304 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Subject message not passing to outlook window from VB6.0 Pin
Dave Kreskowiak1-May-14 5:23
mveDave Kreskowiak1-May-14 5:23 
QuestionNeed help on "Competition Scheduling" Algorithm Pin
N.Wang30-Apr-14 16:43
professionalN.Wang30-Apr-14 16:43 
QuestionTwitter REST API V1.1 Pin
Pete_12328-Apr-14 8:10
Pete_12328-Apr-14 8:10 
AnswerRe: Twitter REST API V1.1 Pin
Richard Deeming28-Apr-14 8:27
mveRichard Deeming28-Apr-14 8:27 
GeneralRe: Twitter REST API V1.1 Pin
Pete_12328-Apr-14 9:20
Pete_12328-Apr-14 9:20 
AnswerRe: Twitter REST API V1.1 Pin
HenryHugo28-Apr-14 21:38
professionalHenryHugo28-Apr-14 21:38 
QuestionVB.Net - Best practice to store paths as relative path Pin
Bart Van Eyndhoven27-Apr-14 23:42
Bart Van Eyndhoven27-Apr-14 23:42 
AnswerRe: VB.Net - Best practice to store paths as relative path Pin
Richard Deeming28-Apr-14 2:07
mveRichard Deeming28-Apr-14 2:07 
You'll need to start by converting the mapped drive paths to UNC paths. If you have a fixed mapping scheme, you could do that manually. Otherwise, you'll need to P/Invoke WNetGetUniversalName[^] to convert the local paths to UNC paths.

Once you have consistent paths, you can use the Uri class[^] to parse the paths, and the MakeRelativeUri method[^] to get the relative paths.
VB.NET
Dim basePath As New Uri("\\fileserver\resx\resources\")
' NB: The trailing back-slash is required to identify "resources" as a directory.

Dim pathA As New Uri("\\fileserver\resx\resources\img\img1.jpg")
Dim pathARelative As String = basePath.MakeRelativeUri(pathA).ToString()
' Contains "img/img1.jpg"

Dim pathB As New Uri("\\fileserver\audio\tracks\track1.mp3")
Dim pathBRelative As String = basePath.MakeRelativeUri(pathB).ToString()
' Contains "../../audio/tracks/track1.mp3"




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: VB.Net - Best practice to store paths as relative path Pin
Bart Van Eyndhoven28-Apr-14 2:41
Bart Van Eyndhoven28-Apr-14 2:41 
GeneralRe: VB.Net - Best practice to store paths as relative path Pin
Richard Deeming28-Apr-14 2:48
mveRichard Deeming28-Apr-14 2:48 
Questionhow to combine 3 cells into one cell in datagridview Pin
sensizbenlik26-Apr-14 15:22
sensizbenlik26-Apr-14 15:22 
AnswerRe: how to combine 3 cells into one cell in datagridview Pin
khei-chan00729-Apr-14 20:48
khei-chan00729-Apr-14 20:48 
AnswerRe: how to combine 3 cells into one cell in datagridview Pin
Simon_Whale29-Apr-14 22:14
Simon_Whale29-Apr-14 22:14 
QuestionPrevent clicking on controls inside a groupbox without disabling Pin
dilkonika26-Apr-14 2:38
dilkonika26-Apr-14 2:38 
AnswerRe: Prevent clicking on controls inside a groupbox without disabling Pin
Dave Kreskowiak26-Apr-14 3:07
mveDave Kreskowiak26-Apr-14 3:07 
GeneralRe: Prevent clicking on controls inside a groupbox without disabling Pin
dilkonika26-Apr-14 4:06
dilkonika26-Apr-14 4:06 
GeneralRe: Prevent clicking on controls inside a groupbox without disabling Pin
Dave Kreskowiak26-Apr-14 13:31
mveDave Kreskowiak26-Apr-14 13:31 
GeneralRe: Prevent clicking on controls inside a groupbox without disabling Pin
dilkonika27-Apr-14 3:35
dilkonika27-Apr-14 3:35 
GeneralRe: Prevent clicking on controls inside a groupbox without disabling Pin
Dave Kreskowiak27-Apr-14 6:45
mveDave Kreskowiak27-Apr-14 6:45 
GeneralRe: Prevent clicking on controls inside a groupbox without disabling Pin
dilkonika27-Apr-14 7:47
dilkonika27-Apr-14 7:47 
GeneralRe: Prevent clicking on controls inside a groupbox without disabling Pin
Dave Kreskowiak27-Apr-14 11:13
mveDave Kreskowiak27-Apr-14 11:13 
GeneralRe: Prevent clicking on controls inside a groupbox without disabling Pin
dilkonika1-May-14 4:25
dilkonika1-May-14 4:25 
GeneralRe: Prevent clicking on controls inside a groupbox without disabling Pin
Dave Kreskowiak1-May-14 5:22
mveDave Kreskowiak1-May-14 5:22 
GeneralRe: Prevent clicking on controls inside a groupbox without disabling Pin
dilkonika1-May-14 6:15
dilkonika1-May-14 6:15 
Questionmerge column but no spaces between data [Solved] Pin
khei-chan00725-Apr-14 16:37
khei-chan00725-Apr-14 16:37 

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.