|
hii all;
is any one knows how to use "Push model" in client server communication or what is exactlly Push Model Algorithm.?
marcoryos
|
|
|
|
|
A pull model means that the object recieving the message asks for it when it wants it, and a push model means that the object sending a message is responsible for sending it without waiting for a request.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a component that generates an xml document. I need to post the xml to another web site from the component via http. I know the msxml component can do this, but I was hoping to find something native to .net that could handle this. Does anyone know where to look for this? Or will I have to use interop to use the msxml dll? Also, if I have to go that route, can anyone recommend a good tutorial on that? I haven't done anything with interop before so I'm a little unclear on how to figure out what the entrypoint is and so forth. Thanks.
|
|
|
|
|
|
|
can some one help me out i am trying to display a picture in form1 picturebox into form2 picturebox(the same picture) i thought of using the parent and child thingie but i could not acheive what i want.
thankz in advance
|
|
|
|
|
couldn't you just do this:
pictureBox1.Image = Image.FromFile(@"c:\image.jpg");
pictureBox2.Image = pictureBox1.Image;
yep, I just tried it and had success.
(I used this code on the click of a button with two picture boxes set to default value names)
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = Image.FromFile(openFileDialog1.FileName);
pictureBox2.Image = pictureBox1.Image;
}
|
|
|
|
|
but his pictureBox1 and pictureBox2 are in two different forms...
David
|
|
|
|
|
You can expose that picture (IIRC Image property of PictureBox ) as public property of both forms. Than you can set image from one form to other.
David
|
|
|
|
|
Hi,
I want to calculate the negation for the given decimal number.
How can i achieve that in C#.
The following calculation is required in C#.
I am done in converting the IP to binary.
But, how can i calculate the negation for the given Mask? Which need to be used in XOR.
Bin of 172.16.0.0 10101100.00010000.00000000.00000000
~Mask ~255.255.240.0 00000000.00000000.00001111.11111111
-----------------------------------------------------------
^ (XOR) 10101100.00010000.00001111.11111111
Result:dec 172.16.15.255
Thanks in advance.
Subrahmanyam.
|
|
|
|
|
Use the ^ operator for xor:
byte[] ip = {172,16,0,0};<br />
byte[] mask = {255,255,240,0};<br />
byte[] result = new byte[3];<br />
<br />
for (int i=0; i<4; i++) result[i] = ip[i] ^ (~mask[i]);
---
b { font-weight: normal; }
|
|
|
|
|
plz help me!!!!!!!!!!!!!!
I want to display my output form into the internet explorer.....(ex:Like acrobat reader opening in the internet explorer)
Ranjith
|
|
|
|
|
Hi.
Im trying to find a way to hookup to the Window Created, Window Destroyed and Window Activated messages from my C# windows app. NB, id like to hook up to these messages from a system-wide scope and not just my own application (for example, id like to know whenever an internet explorer window is opened or made active.
Is this possible ? Ive managed to hookup to the mouse_ll and keyboard_ll events, but no more !
Can anybody tell me if its possible ? and/or provide an example ?
THanks.~
Roy.
|
|
|
|
|
u can do this with vc there is no hooking with c# on other applications windows messages. even if you used win32 hooking API's implicitly from c#, you will hook only your own Application Messages.
marcoryos
|
|
|
|
|
When I prepare a C# application, is it supposed to work only on a stand-alone machine or it automatically works on a network (intranet) also?
If it automatically works (as a default) on the network also, then is there any way to control the number of computers on the network on which it will work? For example, if I want to allow its operation on only one machine on the network, can I do so, and if yes, then how?
|
|
|
|
|
I want connect to MYSQL database by C# and I want to use storeProcedure to access database but I can't do that. Please help me
|
|
|
|
|
Well to connect to mysql you either need an odbc driver which can be found at mysql's website or microsofts website. afaik mysql doesnt support stored procedures yet - it is only due in version 5 and I think they are far away from that.
|
|
|
|
|
well I dont' know how do you call them .. but certainly MySql does support stored procedures form v.4.1 onwards!
|
|
|
|
|
I call them stored procedures and I beg to differ with you on that statement.
http://dev.mysql.com/doc/mysql/en/roadmap.html[^]
The current production release is 4.1. MySQL 5.0 is available in alpha status. See the table of features and which version they belong to.
|
|
|
|
|
What do you mean when you say that you can't do that? What is it that you need?
---
b { font-weight: normal; }
|
|
|
|
|
I'm trying to resize a gif-image that is transparent. But it looses it's transparesy.
Does someone know how to do this?
My code:
public Bitmap _bitmap = null;
private void getGraphicsFromImageNotStretched(MemoryStream ms, int hight, int width)
{
Image image = Image.FromStream(ms);
double orgHight = (double)image.Height;
double orgWidth = (double)image.Width;
if((orgHight * hight) > (orgWidth * width))
{
double ratio = (orgWidth * width) / (orgHight * hight);
_bitmap = new Bitmap(image, (int)((double)width * ratio), hight);
}
else
{
double ratio = (orgHight * hight) / (orgWidth * width);
_bitmap = new Bitmap(image, width, (int)((double)hight * ratio));
}
image.Dispose();
}
Thanks
Thomas
|
|
|
|
|
I suppose it's because it is a GIF image it has a palette. When you resize it, it has to be converted to a true color image (or the resizing would look awful), and the transparency is lost.
If you convert it to true color before you resize it, it should be possible to keep the transparency.
If you use a true color PNG image with aplha channel transparency instead, it will work, and it will look much better. I use this for water marks on images.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for your replay.
I've tried different things out, but I don't seem to get it right.
The closest I've come is getteing a light-blue background (using PNG).
You don't have a code-snipp that could get me in the right direction.
Thanks
Thomas
|
|
|
|
|
As I said, I have used a transparent PNG, and I had no problem at all with the transparency.
How do you use the resized image? Are you saving it as a file? If so, what file format are you using?
---
b { font-weight: normal; }
|
|
|
|
|
I'm creating small icons of images in an ASP page, so I'm writing the images to the output stream.
First I'm resizing the image, witch data I get from a memory stream (this data is an transparent image):
public Bitmap _bitmap = null;
private void getGraphicsFromImageNotStretched(MemoryStream ms, int hight, int width)
{
Image image = Image.FromStream(ms, true);
double orgHight = (double)image.Height;
double orgWidth = (double)image.Width;
if((orgHight * hight) > (orgWidth * width))
{
double ratio = (orgWidth * width) / (orgHight * hight);
_bitmap = new Bitmap(image, (int)((double)width * ratio), hight);
_bitmap.Palette = image.Palette;
_bitmap.MakeTransparent();
}
else
{
double ratio = (orgHight * hight) / (orgWidth * width);
_bitmap = new Bitmap(image, width, (int)((double)hight * ratio));
_bitmap.Palette = image.Palette;
_bitmap.MakeTransparent();
}
image.Dispose();
}
Then I write the data to the output stream:
public static byte[] GenerateImageBytes(Bitmap theBitmap)
{
byte[] bytes = null;
// save the image to the output stream
System.IO.MemoryStream ms = new System.IO.MemoryStream();
theBitmap.Save(ms, ImageFormat.Png);
bytes = ms.ToArray();
ms.Close();
return bytes;
}
This result in an image that is not treansparent
Thanks
Thomas
|
|
|
|