使用button 做成fileupload的功能?
我只会使用fileupload上传文件,但现在要求使用button+textbox代替它,但是不知道怎么写? --------------------编程问答-------------------- 自定义控件,然后拖上去一个button和一个textbox组成一个组合控件即可 --------------------编程问答-------------------- DevExpress控件库有现成的。很好用。(WinForm) --------------------编程问答-------------------- button 事件里写:OpenFileDialog file = new OpenFileDialog();
if (file.ShowDialog(this) == DialogResult.Cancel) return;
textbox.Text=file.FileName;
LZ试试呗
--------------------编程问答-------------------- private void Button_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog dia = new OpenFileDialog();
dia.Multiselect = false;
if (dia.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string fileName = dia.FileName;
this.txtFileName.Text = fileName;
}
} --------------------编程问答-------------------- LS两位+
补充:.NET技术 , C#