What version / flavor of Ubuntu? If the network browsing is handled by gvfs, you may be able to access your remote share programatically via the gvfs usermount - in Ubuntu 12.04 that should be at ~/.gvfs (i.e. /home/username/.gvfs) e.g.
although I believe it has moved in newer releases to somewhere like /run/user/XXXX - if you're not sure you can use the 'mount' command e.g.
$ ls ~/.gvfs
users on winbox
$ ls ~/.gvfs/users\ on\ winbox/
$ mount | grep gvfs
gvfs-fuse-daemon on /home/steeldriver/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=steeldriver)