Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 146799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:40:04+00:00 2026-05-11T08:40:04+00:00

I have a WinForms client-server app running on a Novell network that produces the

  • 0

I have a WinForms client-server app running on a Novell network that produces the following error when connecting to the lone Windows 2003 Server on the network:

TYPE: System.IO.IOException MSG: Logon failure: unknown user name or bad password.  SOURCE: mscorlib SITE: WinIOError    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)   at System.IO.Directory.InternalGetFileDirectoryNames(String path,     String userPathOriginal, String searchPattern, Boolean includeFiles,      Boolean includeDirs, SearchOption searchOption)   at System.IO.DirectoryInfo.GetFiles(String searchPattern,      SearchOption searchOption)   at System.IO.DirectoryInfo.GetFiles(String searchPattern)   at Ceoimage.Basecamp.DocumentServers.ClientAccessServer.SendQueuedFiles(     Int32 queueId, Int32 userId, IDocQueueFile[] queueFiles)   at Ceoimage.Basecamp.ScanDocuments.DataModule.CommitDocumentToQueue(     QueuedDocumentModelWithCollections doc, IDocQueueFile[] files) 

The customer’s network admin manages the Windows Server connection by manually synchronizing the workstation username and password with a local user on the server. The odd thing about the error is that the user can write to the server both before and after the error, all without explicitly logging on.

Can you explain why the error occurs and offer a solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:40:04+00:00Added an answer on May 11, 2026 at 8:40 am

    I have this same problem when trying to access the file system of a windows server in a different domain. The problem is that the user account that the program is running under does not have access to the remote server. Windows does extra work behind the scenes to make it look seamless when you use Windows Explorer because it guesses that your remote credentials will match your local credentials.

    If you map a drive locally to the remote server, then use the locally mapped drive in your code, you shouldn’t have the problem. If you can’t map a drive, but you can hard code the credentials to use for the remote server, then you can use this code:

    using System; using System.ComponentModel; using System.Runtime.InteropServices; using System.Security.Principal;  namespace Company.Security {     public class ImpersonateUser : IDisposable     {         [DllImport('advapi32.dll', SetLastError=true)]         private static extern bool LogonUser(string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, out IntPtr phToken);          [DllImport( 'kernel32', SetLastError = true )]         private static extern bool CloseHandle(IntPtr hObject);          private IntPtr userHandle = IntPtr.Zero;         private WindowsImpersonationContext impersonationContext;          public ImpersonateUser( string user, string domain, string password )         {             if ( ! string.IsNullOrEmpty( user ) )             {                 // Call LogonUser to get a token for the user                 bool loggedOn = LogonUser( user, domain, password,                     9 /*(int)LogonType.LOGON32_LOGON_NEW_CREDENTIALS*/,                     3 /*(int)LogonProvider.LOGON32_PROVIDER_WINNT50*/,                     out userHandle );                 if ( !loggedOn )                     throw new Win32Exception( Marshal.GetLastWin32Error() );                  // Begin impersonating the user                 impersonationContext = WindowsIdentity.Impersonate( userHandle );             }         }          public void Dispose()         {             if ( userHandle != IntPtr.Zero )                 CloseHandle( userHandle );             if ( impersonationContext != null )                 impersonationContext.Undo();         }     } } 

    Then you can access the remote server by doing this:

    using ( new ImpersonateUser( 'UserID', 'Domain', 'Password' ) ) {     // Any IO code within this block will be able to access the remote server. } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a huge client/server WinForms app that uses .NET remoting to pass DAOs
We have a WinForms app that runs fine on x86, but has many third-party
I have an wcf winforms self-hosted app using nettcpbinding.(net.tcp://aaa.homeip.net:9388) The problem is windows 7
We have a typical business application with an Outlook-looking Winforms client talking to asmx
I have a winforms application that normally is at about 2-4% CPU. We are
We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component to
I have C# winforms application that needs to start an external exe from time
I have a winforms application that presently ships with a chm file for context-sensitive
I have a WinForms app written in C# with .NET 3.5. It runs a
I am building a .NET 3.5 Winforms app that uses WCF services (wsHttp binding)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.