Buenas, soy nueva en esto y estoy viendo las estructuras BYTE, MULTIVIEW, VIEW, y en las tres me esta dando un error cuando quiero ejecutar, les paso el código para que me digan en que estoy errando, gracias.
Primero este es el error que me marca:
"Error de sintaxis, declarador de matriz erróneo. Para declarar una matriz administrada, el especificador de rango precede al de la variable. Para declarar un campo de búfer de tamaño fijo, utilice la palabra clave fixed delante del tipo de campo."
Codigo:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_load(object sender, EventArgs e)
{
hiddenfield1.Value = System.Guid.NewGuid().ToString();
}
protected void button1_click(object sender, EventArgs e)
{
if(FileUpload1.HasFile)
try{
FileUpload1.SaveAs("D:\\" + FileUpload1.FileName);
Label1.Text="nombre archivo " + FileUpload1.PostedFile.FileName + "<br>" + FileUpload1.PostedFile.ContentLength + " kb <br>" + "tipo contenido: "+ FileUpload1.PostedFile.ContentType;
}
catch(Exception ex)
{
Label1.Text="error: "+ex.Message.ToString();
}
else
{
Label1.Text="no especifico archivo";
}
byte mybytearray[];
System.IO.Stream mystream;
mystream = FileUpload1.FileContent;
mybytearray=mystream.toarray();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Página sin título</title>
</head>
<body>
<form id="form1" runat="server">
<asp:HiddenField ID="hiddenfield1" runat=server />
<br />
<asp:FileUpload ID="FileUpload1" runat="server" /><br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="button1_click" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</form>
</body>
</html>