This is a discussion on "[SOLVED] [C#] Having some problems." within the Other Programming Languages section. This forum, and the thread "[SOLVED] [C#] Having some problems. are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] [C#] Having some problems.
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
||||
|
||||
|
[SOLVED] [C#] Having some problems.
Creating a web application that finds some tags and displays them
I've run into some errors and I'm completely stuck! Here is my code:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|
|
#2
|
|||
|
|||
|
Re: [C#] Having some problems.
You've got a couple of problems.
1. You didn't instantiate your "web" variable. You have to say:
That's all the errors I could find, but while I'm at it thought I'd also drop a few comments about your programming logic (I'm feeling a bit patronizing this morning....). If I was you I wouldn't have "info" be a struct, a class would make more sense. I would then make the "find" function private and the class would then find and store the page elements. Elements would be written into private string variables using functions and then use getters/setters to make then visible (read-only). Output would then be done in the main program, not the in the class. I haven't tested this, but it does compile....:
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#3
|
||||
|
||||
|
Re: [C#] Having some problems.
I've got it fixed thanks
needed to instantiate it and remove static from function. Do you know how I could put all the matches of <h2>(.)+</h2> into an array (public header2)? I'm pretty stumped
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#4
|
|||
|
|||
|
Re: [C#] Having some problems.
Arrays are not so cool in C#. Check out ArrayLists or Lists.
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#5
|
||||
|
||||
|
Re: [C#] Having some problems.
Uh what's the difference?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#6
|
|||
|
|||
|
Re: [C#] Having some problems.
ArrayLists are dynamic collections of objects. You can add and remove elements on the fly. Arrays have a set size that can't be changed once they've been initialized. A List is like an ArrayList but it has a Type (string, int, double).
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#7
|
||||
|
||||
|
Re: [SOLVED] [C#] Having some problems.
Got it working thanks to you and some other people on other forums
Thanks +rep
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Fly-out menu problems | karinne | Web Page Design | 13 | Jan 30th, 2008 13:45 |
| [SOLVED] Problems with arrays | Scream | JavaScript Forum | 2 | Jan 10th, 2008 16:15 |
| [SOLVED] Problems with centering in CSS. | mcdanielnc89 | Web Page Design | 26 | Nov 1st, 2007 06:07 |
| [SOLVED] Php code problems | longstand | PHP Forum | 3 | Oct 15th, 2007 10:53 |
| [SOLVED] Server Problems | businessservicesuk | Webforumz Cafe | 11 | Oct 8th, 2007 15:01 |