补充一句HTML如下:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="addnew.aspx.vb" Inherits="ascatvgame.addnew"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>addnew</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server" enctype="multipart/form-data">
<FONT face="宋体">
<TABLE id="Table3" style="WIDTH: 190px; HEIGHT: 35px" cellSpacing="0" cellPadding="0" width="190" align="center" border="0">
<TR>
<TD align="middle">
<asp:Label id="Label10" runat="server" Font-Bold="True">新闻添加</asp:Label>
</TD>
</TR>
</TABLE>
<TABLE id="Table1" style="WIDTH: 530px; HEIGHT: 588px" cellSpacing="0" cellPadding="0" width="530" align="center" border="1" borderColorDark="#000099">
<TR>
<TD style="WIDTH: 90px; HEIGHT: 34px" align="middle">
<asp:Label id="Label1" runat="server" Font-Size="X-Small">类型</asp:Label></TD>
<TD style="HEIGHT: 34px">
<asp:DropDownList id="type" runat="server" Width="100px">
<asp:ListItem Value="sc" Selected="True">sc</asp:ListItem>
<asp:ListItem Value="FIFA">FIFA</asp:ListItem>
<asp:ListItem Value="WarⅢ">WarⅢ</asp:ListItem>
<asp:ListItem Value="CS">CS</asp:ListItem>
<asp:ListItem Value="竞技">竞技</asp:ListItem>
<asp:ListItem Value="周边">周边</asp:ListItem>
</asp:DropDownList></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 24px" align="middle" colSpan="1" rowSpan="1">
<asp:Label id="Label2" runat="server" Font-Size="X-Small">标题</asp:Label></TD>
<TD style="HEIGHT: 24px">
<asp:TextBox id="title" runat="server" Width="368px"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 28px" align="middle" colSpan="1" rowSpan="1">
<asp:Label id="Label3" runat="server" Font-Size="X-Small">内容</asp:Label></TD>
<TD style="HEIGHT: 28px">
<asp:TextBox id="tol" runat="server" Width="368px" TextMode="MultiLine" Height="187px"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 164px" align="middle" colSpan="1" rowSpan="1">
<asp:Label id="Label4" runat="server" Font-Size="X-Small">图片上传</asp:Label></TD>
<TD style="HEIGHT: 164px">
<P> <INPUT style="WIDTH: 384px; HEIGHT: 22px" type="file" size="44" runat="server" id="fileup1"></P>
<P> <INPUT style="WIDTH: 384px; HEIGHT: 22px" type="file" size="44" runat="server" id="fileup2"></P>
<P> <INPUT style="WIDTH: 384px; HEIGHT: 22px" type="file" size="44" runat="server" id="fileup3"></P>
<P> <INPUT style="WIDTH: 385px; HEIGHT: 22px" type="file" size="45" runat="server" id="fileup4"></P>
</TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 39px" align="middle">
<asp:Label id="Label5" runat="server" Font-Size="X-Small">文件上传</asp:Label></TD>
<TD style="HEIGHT: 39px"> </TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 33px" align="middle">
<asp:Label id="Label6" runat="server" Font-Size="X-Small">作者</asp:Label></TD>
<TD style="HEIGHT: 33px">
<asp:TextBox id="zuoze" runat="server"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 33px" align="middle">
<asp:Label id="Label7" runat="server" Font-Size="X-Small">来源</asp:Label></TD>
<TD style="HEIGHT: 33px">
<asp:TextBox id="laiyuan" runat="server"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 33px" align="middle">
<asp:Label id="Label8" runat="server" Font-Size="X-Small">时间</asp:Label></TD>
<TD style="HEIGHT: 33px">
<asp:TextBox id="shijian" runat="server"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px" align="middle">
<asp:Label id="Label9" runat="server" Font-Size="X-Small">更新人</asp:Label></TD>
<TD>
<asp:TextBox id="TextBox6" runat="server"></asp:TextBox></TD>
</TR>
</TABLE>
<TABLE id="Table2" style="WIDTH: 190px; HEIGHT: 35px" cellSpacing="0" cellPadding="0" width="190" align="center" border="0">
<TR>
<TD align="middle">
<asp:Button id="Button1" runat="server" Width="68px" Text="提交"></asp:Button>
<asp:Button id="Button2" runat="server" Width="68px" Text="取消"></asp:Button></TD>
</TR>
</TABLE>
</FONT>
</form>
<FONT face="宋体"></FONT>
</body>
</HTML>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="addnew.aspx.vb" Inherits="ascatvgame.addnew"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>addnew</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server" enctype="multipart/form-data">
<FONT face="宋体">
<TABLE id="Table3" style="WIDTH: 190px; HEIGHT: 35px" cellSpacing="0" cellPadding="0" width="190" align="center" border="0">
<TR>
<TD align="middle">
<asp:Label id="Label10" runat="server" Font-Bold="True">新闻添加</asp:Label>
</TD>
</TR>
</TABLE>
<TABLE id="Table1" style="WIDTH: 530px; HEIGHT: 588px" cellSpacing="0" cellPadding="0" width="530" align="center" border="1" borderColorDark="#000099">
<TR>
<TD style="WIDTH: 90px; HEIGHT: 34px" align="middle">
<asp:Label id="Label1" runat="server" Font-Size="X-Small">类型</asp:Label></TD>
<TD style="HEIGHT: 34px">
<asp:DropDownList id="type" runat="server" Width="100px">
<asp:ListItem Value="sc" Selected="True">sc</asp:ListItem>
<asp:ListItem Value="FIFA">FIFA</asp:ListItem>
<asp:ListItem Value="WarⅢ">WarⅢ</asp:ListItem>
<asp:ListItem Value="CS">CS</asp:ListItem>
<asp:ListItem Value="竞技">竞技</asp:ListItem>
<asp:ListItem Value="周边">周边</asp:ListItem>
</asp:DropDownList></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 24px" align="middle" colSpan="1" rowSpan="1">
<asp:Label id="Label2" runat="server" Font-Size="X-Small">标题</asp:Label></TD>
<TD style="HEIGHT: 24px">
<asp:TextBox id="title" runat="server" Width="368px"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 28px" align="middle" colSpan="1" rowSpan="1">
<asp:Label id="Label3" runat="server" Font-Size="X-Small">内容</asp:Label></TD>
<TD style="HEIGHT: 28px">
<asp:TextBox id="tol" runat="server" Width="368px" TextMode="MultiLine" Height="187px"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 164px" align="middle" colSpan="1" rowSpan="1">
<asp:Label id="Label4" runat="server" Font-Size="X-Small">图片上传</asp:Label></TD>
<TD style="HEIGHT: 164px">
<P> <INPUT style="WIDTH: 384px; HEIGHT: 22px" type="file" size="44" runat="server" id="fileup1"></P>
<P> <INPUT style="WIDTH: 384px; HEIGHT: 22px" type="file" size="44" runat="server" id="fileup2"></P>
<P> <INPUT style="WIDTH: 384px; HEIGHT: 22px" type="file" size="44" runat="server" id="fileup3"></P>
<P> <INPUT style="WIDTH: 385px; HEIGHT: 22px" type="file" size="45" runat="server" id="fileup4"></P>
</TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 39px" align="middle">
<asp:Label id="Label5" runat="server" Font-Size="X-Small">文件上传</asp:Label></TD>
<TD style="HEIGHT: 39px"> </TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 33px" align="middle">
<asp:Label id="Label6" runat="server" Font-Size="X-Small">作者</asp:Label></TD>
<TD style="HEIGHT: 33px">
<asp:TextBox id="zuoze" runat="server"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 33px" align="middle">
<asp:Label id="Label7" runat="server" Font-Size="X-Small">来源</asp:Label></TD>
<TD style="HEIGHT: 33px">
<asp:TextBox id="laiyuan" runat="server"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px; HEIGHT: 33px" align="middle">
<asp:Label id="Label8" runat="server" Font-Size="X-Small">时间</asp:Label></TD>
<TD style="HEIGHT: 33px">
<asp:TextBox id="shijian" runat="server"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 90px" align="middle">
<asp:Label id="Label9" runat="server" Font-Size="X-Small">更新人</asp:Label></TD>
<TD>
<asp:TextBox id="TextBox6" runat="server"></asp:TextBox></TD>
</TR>
</TABLE>
<TABLE id="Table2" style="WIDTH: 190px; HEIGHT: 35px" cellSpacing="0" cellPadding="0" width="190" align="center" border="0">
<TR>
<TD align="middle">
<asp:Button id="Button1" runat="server" Width="68px" Text="提交"></asp:Button>
<asp:Button id="Button2" runat="server" Width="68px" Text="取消"></asp:Button></TD>
</TR>
</TABLE>
</FONT>
</form>
<FONT face="宋体"></FONT>
</body>
</HTML>
解决方案 »
- 验证文本框的值不能超过3个字符应用用Jquery怎么写?
- C#判断textbox值
- IIS里面,设置网站的超时是什么意思?
- FindControl找控件
- 一个有关自动提交一次后不再提交的问题
- 在局域网内访问发布的网站
- Microsoft Visual Studio 2005 可以生成.Net1.1的asp.net程序吗?
- 请问大家有没遇到"用户 'A\ASPNET' 登录失败"的问题?寻求解答.高分报酬!
- 我做的"文件下载" 运行完毕后,进程"webdev.webserver.exe""仍在运行,而且占用内存很大. 个位帮看下应该怎么解决?
- 请问下面这段语句为什么不能居中?
- 为什么老说我的ConnectionString 没有初始化??
- 急死我了!!请问如何注销一个自定义的控件?
Dim LenStr As Int32
LenStr = photo.PostedFile.ContentLength '取得上传图片的数据
Dim streamStr As Stream
streamStr = photo.PostedFile.InputStream '设置缓冲区大小
Dim imageBytes(LenStr) As Byte '写入文件数据
If photo.PostedFile.FileName = "" Then
'alert("请选择一个文件名") streamStr.Read(imageBytes, 0, LenStr) Dim conn As New OleDb.OleDbConnection("server=127.0.0.1;database=zdsw1;password=111111;user id=zdsw") Dim cmd As New OleDb.OleDbCommand("insert into Upload (image) values (@image)", conn) cmd.Parameters.Add("@title", title.Value)
cmd.Parameters.Add("@imageFile", imageBytes) conn.Open()
cmd.ExecuteNonQuery()
Response.Write("成功")
conn.Close()
Response.End()
End If
End Sub
For i = 0 To Request.Files.Count - 1
Dim postedfile As HttpPostedFile = Request.Files(i)
If postedfile.ContentLength > 0 Then
'存储上传文件
Dim filesplit() As String = Split(postedfile.FileName, "\")
Dim filename As String = filesplit(filesplit.Length - 1)
postedfile.SaveAs(Server.MapPath("pic\") & filename)
End If
Next">"