473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Dumbfounded Getting Contents of Array UpperBound

I'm trying to get the file name returned in a server variable and am really
feeling dumb because I haven't figured out how to use the available
methods correctly to get the contents of the array that exists in the upper
bound dimension. Can somebody finish it for me and not let anybody
know I asked? ;-)

string url = Request.ServerVariables["url"];
string [] split = url.Split('/');

// Returns
/Learn.NET/CS/PostBackEvents/UsingLinkButton.aspx
Nov 16 '05 #1
2 3169
Hi clintonG,

If I understand you correctly, you want to read the last entry in the string array list ?

string filename = split[split.Length - 1];

GetUpperBound is mostly used for multidimensional arrays

string filename = split[split.GetUpperBound(0)]; // first dimension

--
Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2
Thank you Morten.

<%= Clinton

"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:opsdaq4ezvklbvpo@stone...
Hi clintonG,

If I understand you correctly, you want to read the last entry in the string array list ?
string filename = split[split.Length - 1];

GetUpperBound is mostly used for multidimensional arrays

string filename = split[split.GetUpperBound(0)]; // first dimension

--
Happy coding!
Morten Wennevik [C# MVP]

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: William Morris | last post by:
I have a one-dimesional array of potentially thousands of items, each of which is a string of at least one up to 30 characters, mixed letters and numbers. I have another array - potentially as...
4
by: Annoyed Programmer | last post by:
Maybe this question has been addressed before, but I just stumbled with the issue so I'll post it here. Since I can remember array declaration in any language I've worked(Basic/VB/VB.NET/C/C++)...
1
by: freddy | last post by:
in my code I am using an array, but it only reads one like it doe not loop Dim i As Integer Dim sr As IO.StreamReader Dim strline, strlines() As String Dim fmtstr As String =...
1
by: plau011 | last post by:
Hi all, I thought I understood .Net Framework with value types and referencetypes but apparently not. So I have this code. Excuse me if it's not 100% correct I cut and paste and shortened it a...
2
by: lab3terch | last post by:
I am a student finishing a class in Visual Basic, and would like some assistance with a program I am working on. I need to read the contents of a file (showing makes of cars on one line and a daily...
11
by: Bob Rock | last post by:
Hello, I have an array of strings and need to find the matching one with the fastest possible code. I decided to order the array and then write a binary search algo. What I came up with is the...
2
by: Zender | last post by:
I'm currently working on a program that generates strings of random characters (up to 7 strings, and up to 8 characters per string), which look much like those of the product keys of programs like...
5
by: John | last post by:
How can I fill an array randomly so it contains a certian range of numbers (1 - 100 for example) ? My Goal is to generate a set of numbers in random order.
5
by: latin & geek via DotNetMonster.com | last post by:
dear all, hi. i have a little sub routine which works fine in my dummy test program, but when i insert it in my main program it throws errors. this is the subroutine: Public Sub...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.