I am having problem coming up with regular expression pattern to give me the full matching tag, that is, like
<a href="http://myserver.com/mydir/ads/page.htm">Test link 1</a>
....when i am scanning for keyword '/ads'..
of coz the scanning is a loop, and the keyword is stored in a variable .. e.g. strKey.
the pattern : @"<a\s.*\shref=\S*", strKey, @"\S*(>|\s)"
doesnt work as it would return anything between the first "<a" (no qoutes) and the last space.
the pattern: @"href=\S*", strKey, @"\S*(>|\s)"
does not give the result i wanted.
I have tried to refer to MSDN, but things seem complex and beyond my understanding capability. I really hope someone
can help me to come up with the right regex pattern.
the tags i will (have to) examine include ... IMG SRC, A HREF, IFRAME SRC
i mean, can u be more specific? exactly where to add? for which pattern?
my program has to cater to tags like these:
<a href="http://myserver.com/ads/page.htm" >test</a> [note the space]
<a href="http://myserver.com/ads/page.htm" id="1">test2</a>
<a href="http://myserver.com/ads/page.htm"><img width=20 height=20 src=sponsor.gif></a>
<img width=20 height=20 src='sponsor.gif'>
i wanna extract the full tag that matches the keywords, yet accomodate for the loose nature of html.
please advise. i have no experience using regex, and all references i have doesnt seem helpful. msdn library is confusing me...
okay im lost..............okay i have 8 images that i want to display in another form that pops up after you select an image from a listbox on the parent form. the 8 images are selectable from the parent and i want them to be viewable in the child.
Ok, I think this is what you're going to want to do.
On the parent form get the selected index of the listbox and pass that into the child form. On the child form take that index id and set that in the imagelist and picturebox controls to display the correct image when that form is loaded.
Parent form code:
int iLBID = listbox1.SelectedIndex;
ChildForm CForm = new ChildForm( iLBID );
CForm.ShowDialog( this );
Child form code:
private int m_iSelID;
// Constructor code.
public ChildForm( int iLBID )
m_iSelID = iLBID;
** remember to add a picturebox and an imagelist control to your child form. Load up the imagelist control in design mode and then set the picturebox image index to the index selected in the parent listbox.
How do i use this....................okay, i have a form that has a list of file names, when those file names are selected i want a seprate form to pop-up showing each selected image. so if i selected image 1 then a form should pop-up showing image 1.
P.s. i've done alot already i think my brain is on "E", so could please help!!!
I have several lists with different items. All of them should have copy, cut paste, delete and custom capabilities working from context menus, main menu and toolbar.
If no item of a given type is selected, the buttons and menus entries for that kind should be grey.
When selecting an item the menus and items should change accordingly.
When choosing a menu entry or toolbar button, the action should be applied to the selected item.
Basically, have the same behaviour office or developer studio have.
What is the best way of implementing such thing?
Who’s responsible to recognize the selected item? How?
How do I apply actions over the selected Item? Using events?
Does Visual Studio or .Net framework natively support a specific way of solving this?
I have created a diagram building application (something
like a "diet Visio" ) with an abstract Shape class every
drawing shape have to inherit.
My program has plug-in support so users can create their
own shapes (derived from my abstract Shape class). The
plug-ins are placed in a separat folder. The dll files in
this folder are dynamically loaded at startup.
Of course, I want my program to be able to save and load a
drawing. I use the BinaryFormatter and Stream classes to
serialize the drawing. This looks ok, but when I
deserialize the same file, I get an exception
(i.e) "Rectangle.dll not found" (or something like that),
because this file is a plug-in, dynamically loaded at
So (finally) my question is: What is the best way to
serialize and deserialize an object (consisting of
dynamically loaded objects) like my drawing object?
I'm trying to get several browser panels on top of each other each with a different opacity. I was wondering if there was any way of setting the opacity for a panel, or if any one had any ideas as to how to go about achieving this effect.
The main reason for serializing this is because the App.exe.config is read-only, so any changes to the settings don't persist. This is where the serialization comes into play. If I can get it to output into the xml file above, I'm golden.
The problem now, is getting it into the correct format. I see two problems with this.
One, the class contains all static members so when I call XmlSerializer.Serialize( <stream>, <object to serialize> ) I don't have an object to use.
Problem two, for each member variable how to output the xml <add key="isConstant" value="true" />, etc.
This is about as far as I get . . .
public static bool isConstant;
public static bool doReports;
Which as you can see, isn't far. I don't know how to have the <add> element for each member variable. It won't let me add [XmlElement("add")] before each member variable. (it complains about using the same element name) And I don't know how to get the correct attributes into the xml.
I don't know anything about this topic but if you like it I know that Wrox press has about exacctly about this topic. You can check wrox.com for more information or at least get source code for somme sample.