|
Hi,
I tried to send a message to other user on
modified 14-May-16 22:09pm.
|
|
|
|
|
Just login and post already.
By the time you get this going ... old news is no news.
|
|
|
|
|
Are you sure that the password goes into the URL, without any obfuscation or encryption?
I'd expect a cooky to be passed or similar, not having a password in the browser-history
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I use pictureBox, when my mouse is near a existing point in range which i defined, i want to set mouse on the existing point.
I use:
Cursor.Position = pictureBox1.PointToScreen(Point.Round(point));
pictureBox1.PointToScreen need point pix as a int,but my variable point is a float, where use PointToScreen, i found that the Cursor.Position is not on my existing point because of float to int convertor.
How can i realize this function accuracy?
|
|
|
|
|
Point.Round converts a PointF to a Point - it rounds up / down fractions of a float to the integer equivalent. It doesn't "round" to a "point in a range" it just converts (1.3, 2.7) to an integer (1, 3)
Since the cursor can't move to "parts of a pixel" it won't have any significant effect on the cursor position on it's own!
So show us what you do to create the PointF and explain why you think that should move the mouse to "near a range" and what it does do.
[edit]Typos[/edit]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
oh, I want to do one effect like AutoCad snap function. I have drawn some graphics, and each graphic have hitpot point, when my mouse is near one point, i hope my mouse can snap it to get the same position.
|
|
|
|
|
You can do it, it's not complex - at least in a simple version:
private Point hotSpot = new Point(50, 50);
private Point lastSnap = new Point(-100, -100);
private void myPictureBox_MouseMove(object sender, MouseEventArgs e)
{
PictureBox pb = sender as PictureBox;
if (pb != null)
{
Point p = e.Location;
int nearX = Math.Abs(p.X - hotSpot.X);
int nearY = Math.Abs(p.Y - hotSpot.Y);
if (nearX <= 10 && nearY <= 10)
{
if (lastSnap != hotSpot)
{
lastSnap = hotSpot;
Cursor.Position = pb.PointToScreen(hotSpot);
}
}
else
{
lastSnap = new Point(-100, -100);
}
}
}
It's not perfect - you probably want to tweek it quite a bit to get it comfortable for the user - but it's a start!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Yes,But my hotSpot is pointF,like PointF(50.4,50.6), if that, Cursor.Postion is not the same as hotspot. Because pb.PointToScreen() need Point, so if i use round(PointF),it is not the same....
|
|
|
|
|
If you use Point.Round on a PointF(50.4, 50.6) you will get a Point(50, 51) - which is the closest an integer Point can get to it - you can't position a mouse pointer to .6 of a pixel because a pixel is the smallest unit of drawing!
The only reason PointF exists is to allow multiple scale and transform operations to not lose accuracy - you can't use them for actual drawing, then have to be converted to Point first.
Just try creating a Point hotSpot, and using Point.Round to give it a value from your PointF.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hello , I need an example of how I use my application behind the nat. In my local network works normal file transfer , sending messages , however I would like to access my external network of my partner. I have a server and used a VPN , however was slow, like an access without relying on my server. I saw some examples UDP hole punching of codes but without success.
I look
|
|
|
|
|
Google for "C# UPNP nat forwarding" for examples.
You can setup NAT stuff if your application is on the inside of the network. You can NOT "punch holes" in a NAT if your code is on the outside of the network the NAT is protecting.
|
|
|
|
|
I not found anything yet. I have a server would be able to make a repeater with a listening port for the partner client.
|
|
|
|
|
You're going to have to a do much better job of explaining exactly what this server does, in which network it is sitting, in which network the clients connecting to it are sitting, how these clients and servers communicate, and what needs to be done.
|
|
|
|
|
So my Windows Server 2008 server with the local ip 192.168.100.1 and public ip 200.124.34.250 and with many open doors. I would like to communicate with this server from another computer of an ip 192.168.0.1 network.
|
|
|
|
|
OK, that doesn't say a whole lot. But, the suggestion I had before still stands. On your server-end you have to setup port forwarding so the router forwards the appropriate ports for your application that's listening on the server. On the client-side you don't have to do anything.
|
|
|
|
|
Getting access my server from outside of my network even used this example to transfer files, released the door and yes.
https://code.msdn.microsoft.com/windowsdesktop/Fixed-size-large-file-dfc3f45d
Now my biggest interest would connect another client outside my network and use my server as a repeater 192.168.100.1 . Example
PC 1: 192.168.10.20 - BRAZIL
PC 2: 192.168.50.50 - ARGENTINA
Thanks for listening.
|
|
|
|
|
Repeater for what?? This is the part you're not explaining. You're implying that your server is going to be transferring traffic to another server somewhere else. OK, so where is this other server? Is it behind a NAT like your server is? If so, it's going to have to have to setup port forwarding too, just like if it was expecting a client to connect to it.
As a matter of fact, your intermediate server has to be a server to an actual client and it also has to be a client to another normal server.
|
|
|
|
|
No , I was an alternative to turn the server on a repeater if I can create a p2p or other method to connect the two computers ( PC server " 192.168.0.2 ") and ( pc client " 192.168.10.5 " ) behind the nat would a better solution .
|
|
|
|
|
That made no sense at all, but in any case, the answer doesn't change.
|
|
|
|
|
I have problem with my code. I don't know how to fix. I just want to get all title and gig_url from JSON url and write it to my arraylist. It showed error at: var obj = JObject.Parse(jsons);
modified 13-May-16 6:15am.
|
|
|
|
|
The response returned from the server is compressed. The HttpWebRequest class supports automatically decompressing the response, but that property is not available from the WebClient class.
There are several workarounds suggested in this StackOverflow thread[^]. For example:
class MyWebClient : WebClient
{
protected override WebRequest GetWebRequest(Uri address)
{
var request = base.GetWebRequest(address);
var http = request as HttpWebRequest;
if (http != null) http.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
return request;
}
}
...
using (var webClient = new MyWebClient())
{
...
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i have 2Dim Array, and have to store the Array-Values with the methode "uploadData"
I get this ErrorMsg.
"Cannot convert source type object[,] to target type object[][]"
Can you tell me, whats wrong with this Code. Can i convert this Array to Target-Array?
Regards Nicole
The Code:
object[][] data = new object[2][]
{
{"Seiten","Kategorie","Kategorie_Domain","Kategorie_Pagename"},
{"Text1","Text2","Text3","Text4"}
};
dataImport.uploadData = (data); <= UploadData is awaiting Array-Format [][]
modified 12-May-16 10:58am.
|
|
|
|
|
Quote: whats wrong with this Code You forgot to share the code
|
|
|
|
|
You can't convert a 2D array directly to a jagged array: they are very different.
A 2D array (say 3 columns of 5 rows of integers) is a block of memory 15 integers long, that is accessed via a row and column address:
myArray[2, 4] => integer at [myArray + (4 * 3 * sizeof(int32)) + 2]
A jagged array is something else: it's a 1D array of references to 1D arrays. So if ther are the same size:
myJaggedArray[2][4] => Get the array at [myJaggedArray + (2 * sizeof(Reference))], then use it in [subArray + (4 * sizeof(int32))] to fetch the value.
You can't "magically" convert between them, because there are memory allocations that need to be done, and bounds checking that changes between them: a jagged array doesn't have to have all it's rows with the same number of columns.
If you want to convert you will have to write the code to allocate the new 1D array, allocate each of the row arrays yourself, and manually fill the appropriate cells.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Converting from autocad dwg file to both PDF and Image
modified 12-May-16 6:25am.
|
|
|
|