Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How do I validate a Server Name entered by user


1 reply to this topic

Rakesh Gupta

Rakesh Gupta
  • Members
  • 11 posts

Posted 03 February 2002 - 16:57

I want to validate Server Name and if the server name is valid then I want to move sertain files to Server.

How do I do this task in ISP 6.3.


clvrmnky

clvrmnky
  • Members
  • 27 posts

Posted 04 February 2002 - 21:21

PathIsUNCServerA() in Shlwapi.dll.  Returns TRUE if the string is a valid UNC path for a server.

There are a bunch of other Win32 functions that can be used for this kind of check, but this one seems the simplest and easiest to use.

To use, you have to load/unload Shlwapi.dll, and invoke the appropriate PathIsUNCServer (you probably want "A").  Pass it the server name in a BYREF STRING formatted like this: "\\\\Servername" and capture the output in a NUMBER.

TRUE under Win32 is "-1".

Never having used any symbols in this DLL, I don't know of any gotchas.  Good luck.