|
Greetings!!
I need to get some text from paragraphs on html pages and i did the next regular expression:
<\s*p[^>]*>(?<1>[\s\S]*)<\s*/\s*p\s*>
where <1> is the group in witch i store all text inside a paragraph.
It works fine on one paragraph.
If i have this sample:
<p> hello 1 </p>
<p> hello 2 </p>
<p> hello 3 </p>
i only get one paragraph that is:
hello 1 </p>
<p> hello 2 </p>
<p> hello 3
What is wrong????
please help me.
thanks.
Bruno Conde.
|
|
|
|
|
It's nothing wrong. The pattern you have made is supposed to work that way.
Make the pattern that mathes the text non-gready by adding a question mark:
[\s\S]*?
---
b { font-weight: normal; }
|
|
|
|
|
Thank you very much for your reply...
It was realy that.
pharaoh
|
|
|
|
|
Hello,
I'm trying to feed a structure to some unmanaged code, the function in the unmanaged code i supposed to fill-in some fields. Can someone help
me translate (marshal) the following to unmanaged code, I have very little experience with this stuff.
Greetz
Dave
Original C++ header code:
typedef struct
{
uint32 uiStructureSize ; // Must be sizeof (tsAT_RETURN_TEMPLATE) (input)
void* pTemplateBfr ; // Buffer to receive template (input/output)
uint32 uiTemplateBfrSize ; // Size of buffer @ pTemplateBfr (input)
uint32 uiTemplateSize ; // Size of template data returned (output)
uint16 uwTemplateQuality ; // Returned template quality (output)
} tsAT_RETURN_TEMPLATE ;
typedef struct
{
uint32 uiStructureSize ;
void* pImageItem ;
void* pOldTemplate ;
BOOL bReturnTemplateOK ;
tsAT_RETURN_TEMPLATE sReturnTemplate ;
} tsAT_BUILD_OR_UPDATE_TEMPLATE ;
My structure's in C#
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct tsAT_RETURN_TEMPLATE
{
public UInt32 uiStructureSize;
public Byte[] pTemplateBfr;
public UInt32 uiTemplateBfrSize;
public UInt32 uiTemplateSize;
public UInt16 uwTemplateQuality;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct tsAT_BUILD_OR_UPDATE_TEMPLATE
{
public UInt32 uiStructureSize;
public Byte[] pImageItem;
public Byte[] pOldTemplate;
public Boolean bReturnTemplateOK;
public tsAT_RETURN_TEMPLATE sReturnTemplate;
}
|
|
|
|
|
how to get the hyperlink column value,from data grid,i show the datagrid in show model dialog box,in run time when i click the column,i want the clicked column value and url field value
m mohamad rafi
|
|
|
|
|
how to get the hyperlink column value,from data grid,i show the datagrid in show model dialog box,in run time when i click the column,the clicked column valu and url field value
m mohamad rafi
|
|
|
|
|
HI All,
Am not an expert here, infact i need an expert to help me.
can any 1 here plz tell how to create an interface which can hold 3d objects in other words, a 3d object library using C#.net
you can directly email to me also.
Jennifer Wadhani
jenniferaahmed@yahoo.com
|
|
|
|
|
There is a directX interface for managed code.
There are loads of samples on the web, it takes abit of getting used to though.
Russ
|
|
|
|
|
How can I make my windows form get maximized onload?
Also, the controls, must I set the size to make it go maximum with respect to the main window?
I want the client window (a control type) to maximize the space left after the menu, toolbars.
|
|
|
|
|
|
emc2 wrote:
Also, the controls, must I set the size to make it go maximum with respect to the main window?
I want the client window (a control type) to maximize the space left after the menu, toolbars.
Use the Dock and Anchor properties to change / set the size of the controls etc., with the changing size of the main window. Experiment with these properties to suit your requirements.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
hi
i need help for displaying icons in graph.
|
|
|
|
|
Hi all
i m facing a problem.
I make a HttpWebRequest to a site to login . it logged in succcfullly for the first time. when i press the button and try again to login with same or diffrent user and pass it hangs on HttpWebResponse.GetResponseStream() . I need this stream to post POST data.
if i close the Application and build again and run it works fine.
Thanks in Advance
Regards
TaRiQ
TaRiQ
|
|
|
|
|
I usually see this if I forget to close a response before making a request.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
thanks for reply
but i m closing the response properly and the point is that every thing works fine when i execute it for the first time but as the program is in execuation and i press the login button again to login again it stuck at HttpWebRequest.GetResponseStream().
Please tell me any hint.
Thanks in Advance
Regards
TaRiQ
TaRiQ RaHiM
|
|
|
|
|
Tariq Rahim wrote:
but i m closing the response properly
Are you absolutely sure about this?
Wise from many questions answered, I won't believe you until I see the code for it. Many times I have looked for errors that does not exist in code that is not even executed, just because people say it is...
---
b { font-weight: normal; }
|
|
|
|
|
uri = new Uri("http://login.passport.net/uilogin.srf?lc=1033&id=2");
req =(HttpWebRequest)WebRequest.Create(uri.AbsoluteUri);
req.Method = "POST";
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4433)";
req.Accept= "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*";
req.Headers.Add("Accept-Language", "en-us");
req.Headers.Add("Cache-Control","no-cache");
req.AllowWriteStreamBuffering=true;
req.KeepAlive = true;
req.Referer = "http://login.passport.com/login.srf?id=2&vv=310&lc=1033";
req.ContentType = "application/x-www-form-urlencoded";
string postdata = "mspppostint="+MSPPT;
byte[] xmlBytes = Encoding.ASCII.GetBytes(postdata);
req.ContentLength = xmlBytes.Length;
// It Stuck here in the GetReuquestStream() as i request for the login 2nd time during the execution of the program
Stream reqStream = req.GetRequestStream();
reqStream.Write(xmlBytes,0,xmlBytes.Length);
// Getting Response of Part I
Response = (HttpWebResponse)req.GetResponse();
stream = new StreamReader(Response.GetResponseStream());
responseHtml = stream.ReadToEnd();
stream.Close();
headers = Response.Headers;
Response.Close();
this is the code and it just stuck at the point where i have writen the comments so pls tell me where i m making wrong
TaRiQ RaHiM
|
|
|
|
|
You have to close the request stream also.
MSDN on GetRequestStream:
CAUTION You must call the Stream.Close method to close the stream and release the connection for reuse. Failure to close the stream will cause your application to run out of connections.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Tariq,
I'm new in c#.net and i also look some this kind of resource as you working on. Please tell me detail about you project, i mean how to connection a remote web server and download file (.zip,.doc,.jpg) using Winform application.
Best Regard,
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
Dear Waqas Assalam-m-Alekum
as faar as ur learning is concerned the only thing is that u can use HttpWebRequest HttpWebResponse Classess to get the HTTP Headers
and WebClient to get the File Downloaded or uploaded
for more info and Detialed Code refer to MSDN or any other site about these clasess
Regards
Tariq Rahim
TAriq
|
|
|
|
|
I read the article "How to create installation patches for VS.NET deployment projects" by mjmeans.
I tried in the same way, they suggested. It works great. But it is working only First time.
I mean, I installed small project in my machine, and I made small changes in my project and created patch in the same way described in the article. I installed that patch, it works fine. Then again I made some other changes and created the patch. In the patch log, it shows correctly the changes files added in the patch. But When I execute the patch, the changes not applied to installed project. Only first time patch working.
I checked the mail address for mjmeans, but I cannot get it.
Azmal
|
|
|
|
|
In C++ I recieved data from a DLLIMPORT call in a char string as follows:
void funct()
{
char *icy=BASS_StreamGetTags( Channel, BASS_TAG_ICY);
for (;*icy;icy+=strlen(icy)+1)
{
char * lowercase;
lowercase = _strlwr(icy);
if (!memcmp(icy,"title :",7))
{
temp = icy;
pCPlayer->WMA_Title = CamelCase(temp.Right(temp.GetLength() - 8));
TRACE("TITLE:"); TRACE( pCPlayer->WMA_Title ); TRACE( "\n");
}
if (!memcmp(icy,"author :",8))
{
temp = icy;
pCPlayer->WMA_Author = CamelCase(temp.Right(temp.GetLength() - 9));
TRACE("AUTHOR:"); TRACE( pCPlayer->WMA_Author ); TRACE( "\n");
}
}
}
In C# I am returning the data to a string. How do I walk thru the data in a C# string like I did in the above example?
|
|
|
|
|
How is the data arranged in the string? What is the separator between the strings in the stream? Is it still a zero character?
---
b { font-weight: normal; }
|
|
|
|
|
The data is a pointer to a series of null-terminated strings is returned, the final string ending with a double null.
|
|
|
|
|
If you have that data in a string, just split it on '\x00' and don't use the last two records in the array, as they will be the strings between the last two terminators and between the last terminator and the end of the string.
---
b { font-weight: normal; }
|
|
|
|