c/s(C#)下Ftp的多文件上传及其上传进度
因为项目要求,制作的一个多文件上传,并显示进度条一段代码(vs2005环境)。
(只为粗略的实现,代码并不规范)
当多个文件上传的时候,需要依次队列形式一个个上传,当上传某个文件的时候,锁定进程,上传完毕再开启锁。
在主类中的上传按钮事件代码:
//
获取openFileDialog控件选择的文件名数组(openFileDialog可多个文件选择)
private
void
button1_Click(
object
sender, EventArgs e)
{
label1.Text
=
""
;
try
{
this
.openFileDialog1.ShowDialog();
path
=
this
.openFileDialog1.FileNames;
//
获取openFileDialog
控件选择的文件名数组
string
strpath
=
""
;
for
(
int
y
=
0
; y
<
path.Length; y
++
)
{
strpath
+=
path[y];
}
textBox1.Text
=
strpath;
&n
相关文档:
// & 与,将指定位置设置为0 | 或,将指定位置设置为1
//注: 只针对纯字母的情况
#include <stdio.h>
#include <string>
int main()
{
char str[6] = "xxing";
std::string str1 = "INGXX";
for(int i = 0; i < 5; i++)
{
str[i] &= 0xdf; ......
c指针的运算有时候还是很迷惑人的。
例如:
struct student {
int num;
int score;
int length;
};
struct student *pt;
pt = (struct student *) malloc(sizeof(struct student));
pt->num = 1;
pt->score = 90;
pt->length = 3 * sizeof(int);
printf("pt length:%d\n", *pt);
pt = (int ......
一. 何谓可变参数
int printf( const char* format, ...);
这是使用过C语言的人所再熟悉不过的printf函数原型,它的参数中就有固定参数format和可变参数(用”…”表示)。
而我们又可以用各种方式来调用printf,如:
printf("%d",value);
printf("%s",str);
printf("the number is %d ,st ......
周五开会做团队成员codereivew, 有同事提出了一个关于gmtime多线程是否安全的问题, 当时觉得程序Link了VC的多线程库,应该不是问题。还好回头核实了一下,发现了竟是一个潜在的bug。
程序分在application(完成项目特定功能)和framework(可重用的核心功能)两部分,线程的启动由framework完成。 app中使用了gmtime/loc ......
C/C++是最主要的编程语言。这里列出了50名优秀网站和网页清单,这些网站提供c/c++源代码。这份清单提供了源代码的链接以及它们的小说明。我已尽力包括最佳的C/C++源代码的网站。这不是一个完整的清单,您有建议可以联系我,我将欢迎您的建议,以进一步加强这方面的清单。
1、http://snippets.dzone.com/tag/c/ --数以千计 ......