By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,934 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,934 IT Pros & Developers. It's quick & easy.

Question about dynamic websites with .net

P: n/a
Hi all.

I am trying to create a dynamic website that has links to the files in a
specicif folder.
Files in the folder will be changing daily.

So far I have put a textbox to html and code in as such:

'
'This writes the amount of files to textbox
'
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dirs As String() = Directory.GetFiles("C:\folder\files", "*")
Dim dir As String
Try
For Each dir In dirs
Console.WriteLine(dir)
Next
textbox.text = ("there is " & i & " items in the folder")
Catch virhe As Exception
Console.WriteLine("The process failed: {0}", e.ToString())
End Try
End Sub

Thing is that now I am jammed.

Tuomo
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
JLW
What are you jammed on?
"Vili" <tu***@viljanmaaPOISTA.com> wrote in message
news:c8**********@phys-news1.kolumbus.fi...
Hi all.

I am trying to create a dynamic website that has links to the files in a
specicif folder.
Files in the folder will be changing daily.

So far I have put a textbox to html and code in as such:

'
'This writes the amount of files to textbox
'
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dirs As String() = Directory.GetFiles("C:\folder\files", "*")
Dim dir As String
Try
For Each dir In dirs
Console.WriteLine(dir)
Next
textbox.text = ("there is " & i & " items in the folder")
Catch virhe As Exception
Console.WriteLine("The process failed: {0}", e.ToString())
End Try
End Sub

Thing is that now I am jammed.

Tuomo

Nov 20 '05 #2

P: n/a
"JLW" <as***@someplace.com> wrote in message news:<#e**************@TK2MSFTNGP11.phx.gbl>...
What are you jammed on?
"Vili" <tu***@viljanmaaPOISTA.com> wrote in message
news:c8**********@phys-news1.kolumbus.fi...
Hi all.

I am trying to create a dynamic website that has links to the files in a
specicif folder.
Files in the folder will be changing daily.

So far I have put a textbox to html and code in as such:

'
'This writes the amount of files to textbox
'
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dirs As String() = Directory.GetFiles("C:\folder\files", "*")
Dim dir As String
Try
For Each dir In dirs
Console.WriteLine(dir)
Next
textbox.text = ("there is " & i & " items in the folder")
Catch virhe As Exception
Console.WriteLine("The process failed: {0}", e.ToString())
End Try
End Sub

Thing is that now I am jammed.

Tuomo

Hi if you are jammed on the above sample it's probably because you
haven't got your i declared, or don't do i +=1, if you've got another
problem please be a bit more specific.

Gr Peter
Nov 20 '05 #3

P: n/a

"Piedro" <pp*****@hotmail.com> wrote in message
news:b7**************************@posting.google.c om...
"JLW" <as***@someplace.com> wrote in message

news:<#e**************@TK2MSFTNGP11.phx.gbl>...
What are you jammed on?
"Vili" <tu***@viljanmaaPOISTA.com> wrote in message
news:c8**********@phys-news1.kolumbus.fi...
Hi all.

I am trying to create a dynamic website that has links to the files in a specicif folder.
Files in the folder will be changing daily.

So far I have put a textbox to html and code in as such:

'
'This writes the amount of files to textbox
'
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim dirs As String() = Directory.GetFiles("C:\folder\files", "*")
Dim dir As String
Try
For Each dir In dirs
Console.WriteLine(dir)
Next
textbox.text = ("there is " & i & " items in the folder")
Catch virhe As Exception
Console.WriteLine("The process failed: {0}", e.ToString())
End Try
End Sub

Thing is that now I am jammed.

Tuomo

Hi if you are jammed on the above sample it's probably because you
haven't got your i declared, or don't do i +=1, if you've got another
problem please be a bit more specific.

Gr Peter


Ok I wasnt so clear about my problem.
I have a folder where I have files.
I am trying to make a small script that displays the files to and html file
so that I could
<name of the file> <url to the file>

I have now realised that I have been trying to do this the wrong way.

So I switched to ASPX -file with VBScript and now I have gotten little
closer to solving this.

Tuomo

Ps. Piedro I sent this first only to you by mistake. Not meaning to spam :)
Nov 20 '05 #4

P: n/a
"Vili" <tu***@viljanmaaPOISTA.com> wrote in message news:<c9**********@phys-news1.kolumbus.fi>...
"Piedro" <pp*****@hotmail.com> wrote in message
news:b7**************************@posting.google.c om...
"JLW" <as***@someplace.com> wrote in message

news:<#e**************@TK2MSFTNGP11.phx.gbl>...
What are you jammed on?
"Vili" <tu***@viljanmaaPOISTA.com> wrote in message
news:c8**********@phys-news1.kolumbus.fi...
> Hi all.
>
> I am trying to create a dynamic website that has links to the files in a > specicif folder.
> Files in the folder will be changing daily.
>
> So far I have put a textbox to html and code in as such:
>
> '
> 'This writes the amount of files to textbox
> '
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Dim dirs As String() = Directory.GetFiles("C:\folder\files", "*")
> Dim dir As String
> Try
> For Each dir In dirs
> Console.WriteLine(dir)
> Next
> textbox.text = ("there is " & i & " items in the folder")
> Catch virhe As Exception
> Console.WriteLine("The process failed: {0}", e.ToString())
> End Try
> End Sub
>
> Thing is that now I am jammed.
>
> Tuomo
>
>

Hi if you are jammed on the above sample it's probably because you
haven't got your i declared, or don't do i +=1, if you've got another
problem please be a bit more specific.

Gr Peter


Ok I wasnt so clear about my problem.
I have a folder where I have files.
I am trying to make a small script that displays the files to and html file
so that I could
<name of the file> <url to the file>

I have now realised that I have been trying to do this the wrong way.

So I switched to ASPX -file with VBScript and now I have gotten little
closer to solving this.

Tuomo

Ps. Piedro I sent this first only to you by mistake. Not meaning to spam :)


No problem Tuomo, we're all just human and can make a mistake. But
Tuomo first I've got a question for you, have you ever been to
Belgium? Because at my school in Geel we once had a guest speaker from
Finland and if I remember it well his name also was Tuomo Vili. Now
maybe this code can help you:
///
Dim strFile() As String
Dim x As Integer
strFile = System.IO.Directory.GetFiles("C:\folder\files" )

For x = 0 To strFile.GetUpperBound(0)

Dim flInfo As System.IO.FileInfo

Dim strName As String

flInfo = New System.IO.FileInfo(strFile(x))

strName = flInfo.Name 'gets only the filename
Debug.WriteLine(strFile(x)) 'gets the fully qualfied name
Debug.WriteLine(strName)

Next
///
but because you want it displayed in a html page, you'll have to add
something like this in the for loop:
response.write("Klik the file to go to the link:<a href='" &
strFile(x) & "'> " & strName & "</a>")

Hope this helps you sorry for the slow response, but I'm at my work.

Greetz Peter
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.