1.多个File Field,像sohu2.DROPDOWNLIST有个add
解决方案 »
- 想要一份Socket网络编程的教程
- 在线等,求助Installshield,急用!!!!!
- 访问Oracle中的数据时,如果使用带Params(参数)的sql语句时,要几分钟才能返回结果。这是怎么回事?
- 一道简单的C#变量问题
- 新手问题小集
- 要想实现异步调用,只能通过异步委托来实现,对吗??
- 如何在datagrid中显示二个关系表的列在线等
- 大家觉得的IT业技术含量排行是什么?
- 请问怎么把十二小时制时间转换为二十四小时制的时间格式,谢谢!!
- 我该怎么办?(安装Windows 2000 Service Pack 1 )
- 根据名称获得页面的某些对象,以及对这些对象可以进行操作?
- 水晶报表如何对打印数据精确定位?
Inherits System.Windows.Forms.UserControl#Region " Windows Form Designer generated code " Public Sub New()
MyBase.New() 'This call is required by the Windows Form Designer.
InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'UserControl1 overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub 'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
Friend WithEvents Button2 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
Me.Button2 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'TextBox1
'
Me.TextBox1.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(192, Byte), CType(128, Byte))
Me.TextBox1.Location = New System.Drawing.Point(8, 8)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.ReadOnly = True
Me.TextBox1.Size = New System.Drawing.Size(216, 20)
Me.TextBox1.TabIndex = 0
Me.TextBox1.Text = ""
'
'Button1
'
Me.Button1.BackColor = System.Drawing.Color.Gray
Me.Button1.ForeColor = System.Drawing.SystemColors.ControlLightLight
Me.Button1.Location = New System.Drawing.Point(56, 40)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(144, 23)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Open Document"
'
'Button2
'
Me.Button2.BackColor = System.Drawing.Color.Gray
Me.Button2.ForeColor = System.Drawing.Color.White
Me.Button2.Location = New System.Drawing.Point(232, 8)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(24, 23)
Me.Button2.TabIndex = 2
Me.Button2.Text = "..."
'
'FileOpenDialogInWebForm
'
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button2, Me.Button1, Me.TextBox1})
Me.Name = "FileOpenDialogInWebForm"
Me.Size = New System.Drawing.Size(264, 72)
Me.ResumeLayout(False) End Sub#End Region Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
OpenFileDialog1.ShowDialog()
TextBox1.Text = OpenFileDialog1.FileName
End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
System.Diagnostics.Process.Start(TextBox1.Text)
End SubEnd Class
protected System.Web.UI.HtmlControls.HtmlInputFile Text1;
protected System.Web.UI.WebControls.DropDownList myInputList;
protected System.Web.UI.WebControls.Button btn_Upload;....private void btn_Upload_Click(object sender, System.EventArgs e)
{
ListItem items=new ListItem(Text1.Value.ToString(),Text1.Value.ToString());
myInputList.Items.Add(Text1.Value);
}多几个的话可以循环
THANK YOU!
MY MAIL ADDRESS:[email protected]
你的办法是可以,但是我在实行时发现添加的文件SERVER端必须存在,而且发送
的也是SERVER端的文件。不知道这问题如何解决。
发送的附件肯定是在客户的机子上的。
不对,发送的服务器端的文件。
下面是程序的一些设置:
1,webform上放一个html的file field控件,并且是作为server控件的(如果不是代码就不能访问)。
2,一个添加按钮,把file field控件读入的文件名追加到dropdownlist中。
lstadd.Items.Add(File1.Value.ToString());
3,发送按钮,把dropdownlist中的文件名追加到MailMessage并发送。
//添付
for(int i=0;i<lstadd.Items.Count;i++)
mailobj.Attachments.Add(new MailAttachment(lstadd.Items[i].Value.ToString()));
file field控件选择的确实是客户端的文件,可是发送时如果SERVER端没有该文件则出错,有则发送SERVER端的文件。
sohu等应该就这样吧。下面2个可能对你有帮助支持SMTP服务器认证的邮件发送组件V1.0B(附源码)
http://www.aspxcn.com/dotnetdown/show.aspx?id=49WebService邮件发送服务系统(附源码,推荐)
http://www.aspxcn.com/dotnetdown/show.aspx?id=67
谢谢!
这个问题解决了。20分奉上。