感謝 Graham Bradshaw 的幫助

www.codeproject.com

I have done an COM library that using VC++6.0, there is "Logon" interface was contained and detail codes below:

NETRESOURCE nr;
::memset(&nr, NULL, sizeof(NETRESOURCE));

nr.dwType = RESOURCETYPE_ANY;
nr.lpRemoteName = str.LockBuffer();
nr.lpProvider = _T("Microsoft Windows Network");
nr.dwDisplayType = RESOURCEDISPLAYTYPE_SERVER;

DWORD dwResult = ::WNetAddConnection2(&nr, _T("password"), _T("username"), CONNECT_UPDATE_PROFILE);



the "Logon" interface is successful to return "NO_ERROR" which are invoked by VB. but while the "Logon" interface is invoked by ASP(Active Service Page), however results is to return a error that's:

ERROR_NO_SUCH_LOGON_SESSION

to search into "Winerror.h" that have some description about the error:

// A specified logon session does not exist. It may already have
// been terminated.


via Google to search about the "ERROR_NO_SUCH_LOGON_SESSION", Unfortunate nothing can hele me.


This is a bit of a guess, but I would imagine that the problem stems from the security context that the ASP page is running under. Under XP and 2003, network access for the web server is severely limited. The CONNECT_UPDATE_PROFILE flag might also be causing the problem - I'm not sure that the relevant security context has a "profile" to be updated.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章