Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

neuberfran

preciso que alguém traduza pra mim de VB.NET pra C# 3

Recommended Posts

O que você quer exatamente amigão??!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

esse é o código correto

 

 

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

Me.Title = "USS Isherwood DD-520"

 

'retrieve selected files of a folder

Dim files() As String

Dim i As Integer

files = Directory.GetFiles(Server.MapPath("~\Images"), "*.jpg")

 

If Page.IsPostBack Then

Me.imgMain.ImageUrl = Request.QueryString("Img")

End If

 

Dim arrIbs(files.Length) As ImageButton

For i = 0 To files.Length - 1

Dim image As New Bitmap(files(i).ToString)

arrIbs(i) = New ImageButton()

arrIbs(i).ImageUrl = files(i).ToString()

arrIbs(i).Width = 160

arrIbs(i).Height = 100

arrIbs(i).BorderStyle = BorderStyle.Inset

arrIbs(i).BorderWidth = 2

arrIbs(i).AlternateText = System.IO.Path.GetFileName(files(i).ToString())

arrIbs(i).PostBackUrl = "default.aspx?Img=" & files(i).ToString()

Me.pnlThumbs.Controls.Add(arrIbs(i))

Dim lbl As New Label

lbl.Text = "<br/>"

pnlThumbs.Controls.Add(lbl)

Next

 

 

End Sub

 

protected void Page_Load(object sender, System.EventArgs e)

{

this.Title = "USS Isherwood DD-520";

 

//retrieve selected files of a folder

string[] files = null;

int i = 0;

files = Directory.GetFiles(Server.MapPath("~\\Images"), "*.jpg");

 

if (Page.IsPostBack) {

this.imgMain.ImageUrl = Request.QueryString("Img");

}

 

ImageButton[] arrIbs = new ImageButton[files.Length + 1];

for (i = 0; i <= files.Length - 1; i++) {

Bitmap image = new Bitmap(files.ToString());

arrIbs(i) = new ImageButton();

arrIbs(i).ImageUrl = files.ToString();

arrIbs(i).Width = 160;

arrIbs(i).Height = 100;

arrIbs(i).BorderStyle = BorderStyle.Inset;

arrIbs(i).BorderWidth = 2;

arrIbs(i).AlternateText = System.IO.Path.GetFileName(files.ToString());

arrIbs(i).PostBackUrl = "default.aspx?Img=" + files.ToString();

this.pnlThumbs.Controls.Add(arrIbs(i));

Label lbl = new Label();

lbl.Text = "<br/>";

pnlThumbs.Controls.Add(lbl);

}

 

 

}

 

 

 

link correto: http://cid-ffd2ad7897d0c5de.office.live.com/self.aspx/.Public/imagegallery.txt

 

RESOLVIDO

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.