SQL SMO and remote file system

Hello!
I'm making an application that connects to SQL Server 2005 and programmatically creates database.And I want to give user an opportunity to choose the location for database files.(Like in SQL Server Management Studio)
If SQL Server located on local machine - there is no problem - I show user FolderBrowserDialog and he's happy. :)
But if SQL Server located on remote machine - I can't access remote file system through FolderBrowserDialog. So what can I do? I've heard that I can use SMO. But how?
[521 byte] By [eugene7_11] at [2007-12-26]
# 1

The Server object of SMO has an EnumDirectories method. That sound promising. You might call it for all top level drive letters C:\ to Z:\

--
SvenC

SvenC at 2007-9-4 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...
# 2
Thanks,

SvenC, that's really usefull.
So I can make something like FolderBrowserDialog, but for the remote file system? And how can I find out the names of hard drives on remote machine? Can I?

eugene7_11 at 2007-9-4 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...
# 3

I would just check all drive letters (C to Z) in a try/catch block, then I would expect that only available drives will not raise an exception.

--
SvenC

SvenC at 2007-9-4 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...

SQL Server

Site Classified