Click here to Skip to main content
16,004,882 members
Home / Discussions / C#
   

C#

 
AnswerRe: Umm...wow...request from one of our IBM guys - He needs to send an EBCDIC blob(not converted to ASCII) to be consumed directly by a C# app Pin
PIEBALDconsult19-May-09 15:20
mvePIEBALDconsult19-May-09 15:20 
AnswerRe: Umm...wow...request from one of our IBM guys - He needs to send an EBCDIC blob(not converted to ASCII) to be consumed directly by a C# app Pin
Moreno Airoldi20-May-09 1:05
Moreno Airoldi20-May-09 1:05 
QuestionWeb file download from C# console application gets 401 Pin
Mike Devenney19-May-09 9:22
Mike Devenney19-May-09 9:22 
AnswerRe: Web file download from C# console application gets 401 Pin
led mike19-May-09 10:13
led mike19-May-09 10:13 
AnswerRe: Web file download from C# console application gets 401 Pin
Noctris19-May-09 10:25
Noctris19-May-09 10:25 
GeneralRe: Web file download from C# console application gets 401 Pin
Baeltazor19-May-09 17:23
Baeltazor19-May-09 17:23 
GeneralRe: Web file download from C# console application gets 401 Pin
Mike Devenney20-May-09 5:04
Mike Devenney20-May-09 5:04 
QuestionRe: Web file download from C# console application gets 401 Pin
Mike Devenney20-May-09 7:21
Mike Devenney20-May-09 7:21 
Ok... turns out I was wrong. D'Oh! | :doh: We are, in fact, not in business. I ran the code and didn't get any error so I assumed that all was well, but I wasn't getting to the line inhe code where the response was requested. When I removed the breakpoint and re-ran the code the 401 error was still happening on the line where I do:
WebResponse wr = myReq.GetResponse();


Anyone have any experience with the Automated SWIFT download that can see something in the code below that could be causing it to fail? I've spoken with their support team but they don't offer support on automation, all they could do is verify that my username and password were correct and that I was authorized (ironic, no?) to download the file.

// build credentials for SWIFT authentication
System.Net.NetworkCredential cred = new System.Net.NetworkCredential(); 
cred.UserName = "mySWIFTUsername"; 
cred.Password = "mwSWIFTPassword";
WebRequest myReq = WebRequest.Create(URL);
myReq.Credentials = cred;                
                
// build credentials for WTC Proxy authentication
myReq.Proxy = WebProxy.GetDefaultProxy();
myReq.Proxy.Credentials = CredentialCache.DefaultCredentials;

// send request and get response
WebResponse wr = myReq.GetResponse();
Stream receiveStream = wr.GetResponseStream();
StreamReader sr = new StreamReader(receiveStream, Encoding.UTF8);
StringBuilder bicFile = new StringBuilder();

// parse response into file, write file out to \\server\BICDownloads
do
{
   line = sr.ReadLine();
   bicFile.Append(line);
} while (line != null);

File.WriteAllText(bicFileTemp, bicFile.ToString());


Mike Devenney

Questionreferencing a control from a string Pin
Tom Wright19-May-09 9:17
Tom Wright19-May-09 9:17 
AnswerRe: referencing a control from a string [modified] Pin
Jimmanuel19-May-09 9:46
Jimmanuel19-May-09 9:46 
GeneralRe: referencing a control from a string Pin
Tom Wright19-May-09 10:25
Tom Wright19-May-09 10:25 
GeneralRe: referencing a control from a string Pin
Tom Wright19-May-09 10:27
Tom Wright19-May-09 10:27 
GeneralRe: referencing a control from a string Pin
Jimmanuel19-May-09 10:38
Jimmanuel19-May-09 10:38 
GeneralRe: referencing a control from a string Pin
Tom Wright19-May-09 10:40
Tom Wright19-May-09 10:40 
GeneralRe: referencing a control from a string Pin
Jimmanuel19-May-09 11:00
Jimmanuel19-May-09 11:00 
GeneralRe: referencing a control from a string Pin
Jimmanuel19-May-09 11:17
Jimmanuel19-May-09 11:17 
AnswerRe: referencing a control from a string [modified] Pin
xcorporation19-May-09 11:05
xcorporation19-May-09 11:05 
GeneralRe: referencing a control from a string Pin
Tom Wright20-May-09 8:45
Tom Wright20-May-09 8:45 
QuestionRegex question Pin
Harvey Saayman19-May-09 8:46
Harvey Saayman19-May-09 8:46 
AnswerRe: Regex question Pin
led mike19-May-09 8:54
led mike19-May-09 8:54 
AnswerRe: Regex question Pin
Noctris19-May-09 8:56
Noctris19-May-09 8:56 
QuestionColor Convertor Pin
Rafone19-May-09 8:34
Rafone19-May-09 8:34 
AnswerRe: Color Convertor Pin
led mike19-May-09 8:50
led mike19-May-09 8:50 
QuestionComboBox AutoComplete with id value Pin
Noctris19-May-09 6:28
Noctris19-May-09 6:28 
AnswerRe: ComboBox AutoComplete with id value Pin
musefan19-May-09 6:42
musefan19-May-09 6:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.