tags:

views:

67

answers:

0

So I am trying to login to MVS via c# to upload a file. Everything worked fine when the server required the user to enter password once. Now, on another server with the same OS, it asks the user to enter password 2x. Once, then once more if the first one worked.

I'm not sure why, but the networkCredentials property is not working in the second case. I'm using WebClient to login and upload the file. The error I get is (530), not logged in. How can I get past this?

-- thanks

UPDATE:

here is the code sample that uploads the file from a windows test environment a MVS mainframe.

        WebClient wc = new WebClient();
        wc.Proxy = null;
        wc.BaseAddress = null;


   string filepath = @"ftp://xx.xx.xx.xx//'x1234.y23.TEMP(" + destinationFile + ")'";
   wc.Credentials = new NetworkCredential(username, password);

try
        {
            byte[] response = wc.UploadFile(filepath , sourceFile);
        //    File.WriteAllBytes(sourceFile + "2", response);
        }
        catch (System.Net.WebException a)
        {
            Console.WriteLine(a.Message);
        }