How to get the user name, and to show a select directory dialog?
Mark Hammond
mhammond at skippinet.com.au
Sun May 25 19:12:12 EDT 2003
Peter Hansen wrote:
>>>>win32wnet.WNetGetUser()
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> RuntimeError: Couldn't get the buffer size!
>
> Looks like, possibly WNetGetUser() (note capitalization) exists but
> has a problem internally, but WNetGetuser() does not even exist.
It works for me on XP - further, I just checked the code, and unlike
another XP specific problem, we aren't relying on a specific error code
to detect this situation - so the current code looks OK.
A quick search through the web suggests that WNetGetUser() may fail if:
* There are invalid characters or spaces in the Computer Name box.
* There is no network client installed.
But I doubt that is your case.
Mark.
More information about the Python-list
mailing list