Discussion on:

23
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
This code stuff has been around as long as Delphi.There is no place that you could type this code and have it work.This is not software writing.Some of these script lines are even recorded from the CPU and BIOS.I could open a dll in a C# interpreter program and see what you have copied and pasted here.To date,however,I could not do this because the Microsoft project folder is needed.
I know I'm going to hate it, but I open it anyway. Sure enough, it's full of those unidentifiable rubbery green bits and the smell of cheap alcohol.
I'm not exactly sure what you're trying to get at but this is the second article of mine you've said this about.

Are you trying to say I'm decompiling some MS software and publishing the code?
0 Votes
+ -
First, BALTHOR almost never returns to defend any of his statements or respond to questions.

Second, he rarely knows what he's talking about. Check his profile and look at some of his previous postings. His DST rants from early this year are particularly enlightening.
Please let the rest of us, because we have all tried to figure him out at one time or another.

I give up, and don't even read his posts anymore. Which is a shame, because from past experience. You can tell he has knowledge... He is waisting what he knows by posting here, because we all ignore him anymore because of the way and manner he rants and runs.

Dan
1 Vote
+ -
It's C#

You should consider bracketting the stream instantiation (at least) with using as well.

It's a good habit to develop.
-1 Votes
+ -
So, its a good sample of using managed code to FTP. Nothing wrong with it..

Hey, can I have some of what you guys are smokin happy

We use JustFTP in a script overnight to transfer files.

Bye.
0 Votes
+ -
Using is a good habit to develop and I guarantee if you compile this code with your trusty GNU compiler it will blow chunks.

Because it's not C
0 Votes
+ -
I totally agree and in production code I make extensive use of using(){}.

For anyone wondering what we're talking about, here is an example:

The code in my article looks like this:
StreamReader stream = new StreamReader("c:\test.txt");
//Do something with the stream
stream.Close();

There is an alternative to this code that ensures the stream is closed without having to explicitly call stream.Close() - that code is shown below:

using (StreamReader stream = new StreamReader("c:\test.txt"))
{
//Do something with the stream
}
is some poor naive fool believing that guff about not having to manage resources.

If you don't help the garbage collector, you end up with litter everywhere and it's obvious to very one but 'you'
0 Votes
+ -
RE: How do I... Use C
vimHere Updated - 18th Jan 2009
I am getting the following error
: "The remote server returned an error: (530) Not logged in." Please help me solve this. Thanks a lot in advance
0 Votes
+ -
Where ?
Tony Hopkinson 19th Jan 2009
From the code, that would suggest the FTP server doesn't recognise your credentials.
0 Votes
+ -
This one is really a good example.. thanks
Hello, This is realyy a great example. Tahnk you very much. It really helped me happy
But I have a problem when downloading the file.First I tried with an txt file. Worked fine. But now I'm testing with an xml file. It overwrites the existing file. That's good too. Bur the problem is the file is not downloading complete and Everytime it changes. For example sometimes it downloads half and sometimes full and sometimes only few text at the end is missing. What can do about it. Can you please help me? Thanks again :))
0 Votes
+ -
Insert
Tony Hopkinson 5th Jul 2009
file.Flush();

before file.Close();

might fix it.

You need to go through on debug and make sure have the entire content in byte[], if so either flush, or creating the file in a using block might fix your problem.

0 Votes
+ -
Thanks
Yayman 9th Jul 2009
I didn't have time to test again but I'll try your suggesstion. I think file.Flush(); can work. Thanks again. happy
0 Votes
+ -
I really appreciated it. Thank you. But can I have the sample in Visual Studio 2008 version. I fail to convert from the current version.
Simple, straightforward and Effective. Thanks.
0 Votes
+ -
Great
SURFThru 4th Sep 2010
Good example to get the ball rolling. Thanks!
0 Votes
+ -
Excellent Example but there is need to set the null value in property of proxy of WebClient Object if ISA server is on client side.

e.g.
request.proxy = null;
0 Votes
+ -
NgocThanh
ngocthanhstar 14th Jun 2012
Thanks! It's working very good!
I use FtpWebRequest to download multiple files from the server.but when use reqFTP.Credentials to send request, it creates too many connections.how to open a connection and file down a lot, this is my code:
reqFTP = (FtpWebRequest) FtpWebRequest.Create (Uri));
reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential (ftpUserID, ftpPassword);
FtpWebResponse response = (FtpWebResponse) reqFTP.GetResponse ();
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.