Hi
I've been writing an application in MONO C# and I need help, my problem is my aplication has to load some photos from my server which is running windows XP and i need to know how i have to write the photo's path. i mean for windows is somthing like this.
Im using the IO class to load as stream and close inmediately to release the file
the code is something like this (this is in VB in C# is almost the same I just want to ilustrate my trouble):
Public Sub FotoProducto(ByRef whichPicturebox As PictureBox)
Dim fsPicture As System.IO.FileStream
Dim sPath As String
'In windows I use this one and works fine
"\\MyServer\PhotoFolder\picture.jpg"
'in linux I supossed it would be:
sPath = "smb://MyServer/PhotoFolder/picture.jpg"
'I tried with local files and this code worked
sPath = "/home/user/images/sample.jpg"
'I don't know how to acces to files from others machines wich run WinXP
'using the console, That's the reson why I think I'm writing wrong the path,
'I've been looking in a lot of forums with no luck.
Try
fsPicture = New System.IO.FileStream(sPath , FileMode.Open, FileAccess.Read)
Adonde.Image = Image.FromStream(fsPicture)
fsPicture.Close()
fsPicture.Dispose()
Catch ex As Exception
whichPicturebox.Image = My.Resources.Defaultt
End Try
End Sub
I really thak you in advance