Tuesday, May 22, 2007

.Net Framework v2: Class about how to get files form FTP site

FtpWebRequest.BeginGetRequestStream
This class is best way to get file from FTP

String::Concat note(About array^ and array^ )

array<Byte^>^ temp1 = gcnew array<Byte^>^(10);
array<Byte >^ temp2 = gcnew array<Byte >^(10);
 
String^ LinkAllBytes = String::Concat(temp1);----------------------OK
String^ LinkAllBytes = String::Concat(temp2);----------------------NG

Friday, May 18, 2007

.Net Framework v2.0 心得-> 实体数组作为函数的输出参数时应注意的

当实体数组作为函数的输出参数时,只能在函数对内部成员进行修改,但无法改变此实体的大小。
 
如:
 
void main()
{
      array<String^>^ sample = {"Text1", "Text2"};
 
      resize (sample);
 
      printf("sample element 0 = %s\n", sample[0]);
      printf("sample element 1 = %s\n", sample[1]);
      printf("sample size external = %d\n", sample->Length);
}
void resize(array<String^>^ sample)
{
      sample[0] = "Text2";
      sample[1] = "Text1";
      Array::Resize(sample, 4);
      printf("sample size internal = %d\n\n", sample->Length);
}
 
打印:
sample size internal = 4;
 
sample element 0 = Text2;
sample element 1 = Text1;
sample size external = 2;