|
I tested using regexbuddy
for text
"apple"
with my regex
(?<=a).*?(?=e)
returns "ppl"
now i want to get text in between using below regex
(?<=\<p\> \</p\>).*?(?=\<div class="central"\>)
<p> </p>
<p>red delicious.</p>
<div class="central"><p> </p>
<FORM action="x.asp" method="post" >
<INPUT type="hidden" name="oradvertiser" value="3">
<INPUT type="hidden" name="xx" value="test">
<INPUT type="hidden" name="xy" value="test">
<input type="image" src="./main/apple.png" value="Click here" onmouseout="this.style.border='5px solid silver';" />
</form><p> </p>
<p> </p>
<p>riped pear.</p>
<div class="central"><p> </p>
<FORM action="x.asp" method="post" >
<INPUT type="hidden" name="or" value="3">
<INPUT type="hidden" name="xx" value="test">
<INPUT type="hidden" name="xy" value="test">
<input type="image" src="./main/pear.png" value="Click here" onmouseout="this.style.border='5px solid silver';" />
</form><p> </p>
<p>dummy text</p>
but its not giving me "red delicious" and "riped pear"
could you please help?
|
|
|
|
|
this works
<p>&nbsp;&nbsp;&nbsp;</p>\s+<p>(?<content>.*?)</p>\s+<div class="central">
|
|
|
|
|
good
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
try to use
labelname.refrsh()
after the line u changed text property of the lable
|
|
|
|
|
Hi All ,
I can make application for communication between two pc in same network .But I want to make this communication in following case ,
I have two PC PC1 and PC2 want to communicate them,
PC1 is in network in one company 1, and pc2 is in network of company2 ,PC1 have ip 192.168.1.5 and its router add is 122.xxx.xxx.123 similarly PC2 have ip 192.168.1.5 and its router ip is 123.xxx.xxx.78.
then how should i connect them .
Thank You.
|
|
|
|
|
You can't! At least one of them must be visible to the other.
The best solution is to use a server which is visible to both.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Hi all, i asking about marshalling, what it is means, and why we need it???
I face this statment at some code, but i don't know exactly what it means ..;
< // Marshal pointer into a struct
PcapUnmanagedStructures.pcap_if pcap_if_unmanaged =
(PcapUnmanagedStructures.pcap_if)Marshal.PtrToStructure(nextDevPtr,
typeof(PcapUnmanagedStructures.pcap_if));
>
|
|
|
|
|
I'm no expert so this is a rough overview. I'm sure Luc will be along soon to offer a much better description!
Marshalling is data transformation. Things in the managed world are different from the unmanaged world and marshalling takes care of transforming the data so we can pass it between the two worlds.
Unmanaged code often uses pointers to pass the references to values rather than the values themselves. These pointers are marshalled back to managed code to an IntPtr. To get the actual value pointed to, we can use the Marshal class to transform the data at the given reference to a structure as in your example.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
That is just fine, no way to improve on it.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Hello
I have an list array of strings that I would like to display in a list box.
List<string[]> Param = new List<string[]>();
if I do
for (int index = 0; index < Param.Count; index++)
{
listBox1.Items.Add(Param[index][0]+"\t"+Param[index][1]);
}
The output is all skewed depending on what the length of the first string is.
How can I make this a multicolumn listbox, writing each string to the appropiate colummn?
Thank you in advance.
|
|
|
|
|
You should either use a ListView (in Detail view) or a DataGridView as they are multicolumn controls.
Alternatively you could use a fixed width font and calculate the correct position of the second column based on the longest length of the first string - fugly but it will work!
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I tried creating a DataGridView
But when I set the
dataGridView1.DataSource = Param;
it only list the information about the Param structure and not the data inside.
Are you able to show me how to add to the DataGridView data?
Thank you in advance
|
|
|
|
|
See Alex's answer below
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
try this:
for (int index = 0; index < Param.Count; index++)
{
listBox1.Items.Add(Param[index][0]+"\t\t"+Param[index][1]);
}
note:
i use this method before to show lists but it is so hard to get the data back from it so try datagriadview there is more options you can do with it.
|
|
|
|
|
for (int index = 0; index < Param.Count; index++)
{
datagridview.Rows.Add(Param[index][0],Param[index][1]);
}
but you should add col. before you do that:
datagridview.coluomn.Add("1","1");
datagridview.coluomn.Add("2","2");
|
|
|
|
|
hi,
you can use a DataGridView contorl.
Example for you're list like this:
dataGridView1.Columns.Add("column1", "Column1TextToDisplay");
dataGridView1.Columns.Add("column2", "Column2TextToDisplay");
foreach (string[] param in Param)
dataGridView1.Rows.Add(param);
Pretty easy, huh ?
Cheer's,
Alex Manolescu
|
|
|
|
|
Thank you!
It works great, something I can really build on in my project.
Douglas
|
|
|
|
|
You're welcome. Don't forget to rate my reply
Cheer's,
Alex Manoelscu
|
|
|
|
|
I know of two ways to get a ListBox show tabular stuff as you would like it:
1.
use a non-proportional font, such as Courier New (for logs, numbers, etc that is what I do);
2.
make it OwnerDrawn, i.e. provide a DrawItem handler, where you do a Graphics.DrawString() for each of the "columns"; that is what I do when I want one or more columns to use proportional fonts, and/or want to include non-textual information such as icons.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Hi,
I'm new here, and just recently I've been trying to make a program that modifies some registry keys. Don't worry, this isn't malicious. And this is the first time I've coded in quite some time... so i am rusty.
Here goes, I want to automate changing the status of an audio device from enabled to disabled. The issue lies in I get kicked back when using the RegistryKey.OpenSubKey method when I try to have write access. When I get read access, it does open but then I can't change the DeviceState value to disable the device. I have tried using both RegistryPermission & RegistryAccessRule... I had luck with neither. I also went as far as creating a batch file that used "subinalc.exe" to take ownership of the key and then attempt to open it... still nothing.
I tried googling this, but I haven't found anything that proved useful. So my question is, is there a class I could be using that would let me take possession of the key? Or is there another class to set permissions that I haven't found?
I am running VS 2008, and I have tested on two different Win 7 systems (one x86 & one x64).
|
|
|
|
|
From Vista onwards certain parts of the reigistry require the application to be elavated. Adding an application mainfest file and requiring administrator as described here[^] may solve your issue.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I forgot to add that in the original post. I already created the manifest requiring an elevated status.
|
|
|
|
|
OK, if the used doesn't have an admin account, it's not going to work no matter what you do. Virtually everything under HKEY_LOCAL_MACHINE is read-only to normal user accounts.
What's the pat you're trying to write to?
|
|
|
|
|
From within the registry editor there is a permissions window Edit->Permissions which allows you to assign permission to users for keys.
|
|
|
|
|
I'd be very grateful for some help.
My project is as follows:
The user can enter a choice of pizza type; thin crust, medium and thick crust.
Then they can choose the size between 100mm and 1000mm.
The thin crust has a base price of £2.50, the medium £5.00 and the thick £7.50.
Then I need to calculate the size of the pizza selected, add the base price, and let the user confirm their selection.
The confirmed selections have to be appended to a text file with a date stamp. The file should keep adding confirmed records every time the program is run. (crust type, size, cost, and date)
I am still battling with the basics, and hopefully getting on with this project will help.
So far my code is:
string[] size = new string[3];
size[0] = "thin crust";
size[1] = "medium crust";
size[2] = "thick crust";
Console.WriteLine("Enter type of pizza required: 1 = thin crust, 2 = medium crust, 3 = thick crust: ");
int result = int.Parse(Console.ReadLine());
Console.WriteLine("You have chosen the {0} pizza", size[result - 1]);
Console.ReadLine();
}
areaM2:
{
float x;
Console.Write("Please enter number, between 100 and 1000: ");
x = float.Parse(Console.ReadLine());
if ((x >= 100f) && (x <= 1000f))
{
Console.WriteLine("Your number {0} is between 100 and 1000", x);
Console.ReadLine();
}
else
{
Console.WriteLine("You did not enter a valid number: ");
Console.ReadLine();
goto areaM2;
}
}
size[0] = 2.5;
size[1] = 5;
size[2] = 7.5;
x = x * x;
Console.ReadLine();
It would run until I added the last few lines. If someone could tell me how to proceed by assigning the base prices to the sizes, and adding them to an equation, I would be very grateful.
Thanks to those people who helped me earlier, but I think I posted in the wrong place, sorry.
|
|
|
|