|
hi,
does any one know a good class which can post data to a http server and most important read back posted data?
Thanks, i really need it urgent!
|
|
|
|
|
I know few classes, check out System.Net.WebClient ,System.Web.HttpRequest and System.Web.HttpResponse ...
|
|
|
|
|
Eli Nurman wrote: class which can post data to a http server and most important read back posted data?
Sure! That's exactly why I designed this[^] class.
/ravi
|
|
|
|
|
Thanks, but i need a class that could read POSTED data. like if I'm sending to a page which response me with post info (credit card clearing for example) i need to read the post only. do you know any solution?
|
|
|
|
|
Eli Nurman wrote: sending to a page which response me with post info
Do you mean the web page to which you posted data (eg: the credit card number) returns a response (eg: validation success/failure) to the client via a POST ?
/ravi
|
|
|
|
|
yes, that is exactly it! how is it possible to read the POST sent?
BTW i think all clearing companies do so (sending the transactioID etc... data)
|
|
|
|
|
Hi Eli,
Eli Nurman wrote: how is it possible to read the POST sent?
The only thing I can think of is that you'd have to have a server to receive responses from the clearing house.
Eli Nurman wrote: i think all clearing companies do so
I would've thought they send back some token as part of the response, allowing you to conduct an encrypted conversation in order to process the transaction. Much like a series of web service calls.
The "POST response" story seems odd to me, but that's just my opinion.
/ravi
|
|
|
|
|
Thanks Ravi
I guess so
but if there is a class that allows me to read the entire data that has send including headers and post data that can be useful to, no? and then analyze the post data into a dictionary
So if you know a tool that responses the entire received data from the "HTTP/1.1 200 OK" until the end of document please let me know.
Thanks
|
|
|
|
|
I think you want to use the Headers property of HttpWebResponse to get at the headers.
/ravi
|
|
|
|
|
Is it possible (probably by Windows Messages or API) to generate a Moving event for a form and get it's current rectangle so I can cancel the movement if outside the area I specify?
I've tried using the Move and LocationChanged events but they are only raised AFTER the move has taken place, not during.
I've had a browse around Google but with no success so far...
Dave
|
|
|
|
|
Hi,
there is a Form.LocationChanged event; its EventArgs does not offer a Cancel
property, so you would have to remember the old location and restore it, to undo
a move.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks Luc, but I need to catch it whilst it's moving not afterwards. I'll do some more API investigating - there's gotta be a way hidden in there!
Dave
|
|
|
|
|
Hi,
if the available events don't suit your needs, you probably have to deal with
the actual Windows messages themselves, i.e. override the WndProc method,
and suppress all moves, as in
const int WM_MOVE = 0x0003;
protected override void WndProc(ref Message m) {
if (!m.Msg==WM_MOVE) base.WndProc(ref m);
}
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
WndProc is it - thanks. It's actually WM_MOVING (0x0216) that I need. Now, just gotta figure out how to cancel the move. I think I'm going to have to create a rectangle structure and use marshalling to overwrite the windows data. I think I can sort it from here.
Thanks Luc, I'll post back if I get stuck!
Dave
|
|
|
|
|
This code works (where LeftLimit, TopLimit etc... are ints that equal the limits that the form is allowed to move to).
private const int WM_MOVING = 0x0216;
[StructLayout(LayoutKind.Sequential)]
struct RectangleStructure
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_MOVING)
{
RectangleStructure rectangle =
(RectangleStructure)Marshal.PtrToStructure(m.LParam, typeof(RectangleStructure));
if (rectangle.Left < LeftLimit)
{
rectangle.Right = LeftLimit + Width;
rectangle.Left = LeftLimit;
Marshal.StructureToPtr(rectangle, m.LParam, true);
}
if (rectangle.Top < TopLimit)
{
rectangle.Bottom = TopLimit + Height;
rectangle.Top = TopLimit;
Marshal.StructureToPtr(rectangle, m.LParam, true);
}
if (rectangle.Right > RightLimit)
{
rectangle.Left = RightLimit - Width;
rectangle.Right = RightLimit;
Marshal.StructureToPtr(rectangle, m.LParam, true);
}
if (rectangle.Bottom > BottomLimit)
{
rectangle.Top = BottomLimit - Height;
rectangle.Bottom = BottomLimit;
Marshal.StructureToPtr(rectangle, m.LParam, true);
}
}
base.WndProc(ref m);
Dave
modified on Monday, February 18, 2008 1:49 PM
|
|
|
|
|
Great. Thanks for posting the entire solution.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I thought this was a useful little excercise that i learnt a few things through (with your help) so I made a short article here[^] in case you want to have a look.
Many thanks,
Dave
|
|
|
|
|
Nice. I voted 5 lifting your average dramatically (I also reported a little bug [^]in
the average calculation, not showing any more since I casted my vote).
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi
I'm using CodeDom and I want it to generate code such as the following:
if (var is MyClass)
{
}
The code I am currently using to perform the generation is
CodeConditionStatement ifStatement = new CodeConditionStatement();
ifStatement.Condition = new CodeBinaryOperatorExpression(lhs,
CodeBinaryOperatorType.IdentityEquality, rhs);
this code will generate the below statement
if (var == MyClass)
{
}
All that needs to change is the ==, which needs to change to 'is'. Is this possible to do in CodeDom?
Also note that 'var' can also be a child class of MyClass (which is why I did not use var.GetType() == typeof(MyClass))
thanks
|
|
|
|
|
danielk_,
Dunno, why don't you type it and see what happens? Would be a lot quicker than waiting for an answer...
Regards,
Gareth.
|
|
|
|
|
AFAIK it's impossible to generate 'is' using CodeDom. You can try to use typeof(MyClass).IsInstanceOfType(var).
|
|
|
|
|
looks good. IsInstanceOfType should do the job
thanks
|
|
|
|
|
hi
is that anyWay to save html pages to database fully (with all images,styles,...) and retrieve & display it when we request it ?
thanks
|
|
|
|
|
Sure. You need to be able to store a zip or an arbitrary number of files, as you will have no idea how many images there will be.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks for reply
no i don't make zip file, i want to search in it via FTS (full text search) or use Regular Expression in html text.
|
|
|
|