|
Edit->Advanced->Format document (Ctrl+E, D)
|
|
|
|
|
Another solution:
CTRL + K + F
Regards,
Dealon
If we dream, every thing is possible!
|
|
|
|
|
Many overloads of System.Drawing.Graphics use Point array as a parameter. But I've found a puzzling problem with the Point array. The order in which the points are stored in the array creates different shape than intended. I used System.Drawing.Graphics.FillPolygon using four points and two different results came out depending on the order of points(http://img509.imageshack.us/img509/2944/boxch5.jpg[^]). Yes, i could have used the FillRectangle, but i will use figures with more than 4 sides.
I want to know if there is a way to arrange the points so that they have a counterclockwise or clockwise rotation.
|
|
|
|
|
gigahertz205 wrote: The order in which the points are stored in the array creates different shape than intended.
The result is exactly as expected. The FillPolygon doesn't do any calculations to find out which points are nearest to each other, it just draws a polygon using the points in the exact order that you specified.
gigahertz205 wrote: I want to know if there is a way to arrange the points so that they have a counterclockwise or clockwise rotation.
Where do you get the points from, and what's the reason that they are not in that order already?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Well if you look at my previous posts, you will get a basic idea of what im trying to do. I want to divide up an image using arbitrarily oriented lines, and use points of the polygons to edit the contents within that region. Basically, i use two points to create line segments, whose points will be added to Point arrays of that region. But then again, i as i create the line segments, i have no way to enforce which points to add first.
|
|
|
|
|
Hi!
I've just followed an article by Konrad Rotuski about making a simple C# IDE [^] and found it very easy to follow and unserstand, however i am interested in extending it's functionality.
How would i use the compiler to change application properties such as the version and author of the compiled executable?
Thanks!
MrWolfy
|
|
|
|
|
MrWolfy wrote: change application properties such as the version and author of the compiled executable?
You could hack into the executable, but it is best to do this through the source code.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi And Thanks!
Thanks Paul Conrad! That Totally Solved My Problem!
I Just Added this into the program just before compilation:
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("A Title")]
[assembly: AssemblyDescription("Some Description")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Some Company")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
Thanks Again! I Never thought about using the program itself!
Thanks!
MrWolfy
|
|
|
|
|
|
I ditto SharpDevelop. Though I haven't really used it since MS released the Express Editions...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi!
Thanks for the link!
It has really helped me and my project!
Thanks again!
MrWolfy
|
|
|
|
|
Cool deal, dude.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Is there any way to code this action with c#?? cmd, batch file.
When I install my application with InstallShield, I have to do this action manually, I want to code this..
thanks
luisnike19
luisnike19
|
|
|
|
|
Could you describe a little more clearly what you are trying to accomplish?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I want to implement with "code" this, in the ISS 7
In IIS when I right-click, I see options "Convert to Application" with Application Pool as “Classic .NET AppPool”
any idea??
thanks
luisnike19
|
|
|
|
|
hello all
I write a simple ftp ware,here's some code
public void Upload(string filename)
{
FileInfo fileInf = new FileInfo(filename);
string uri = "ftp://127.0.0.1";
FtpWebRequest reqFTP;
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
reqFTP.Credentials = new NetworkCredential(m_userName, m_password);
reqFTP.KeepAlive =true;
reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
reqFTP.UseBinary = true;
reqFTP.ContentLength = fileInf.Length;
int buffLength = 2048;
byte[] buff = new byte[buffLength];
int contentLen;
FileStream fs = fileInf.OpenRead();
try
{
Stream strm = reqFTP.GetRequestStream();
contentLen = fs.Read(buff, 0, buffLength);
while (contentLen != 0)
{
strm.Write(buff, 0, contentLen);
contentLen = fs.Read(buff, 0, buffLength);
}
strm.Close();
fs.Close();
}
catch (Exception ex)
{
}
}
now I have a problem,how to change the path to "ftp://127.0.0.1/test"?of course I can reconnect the server,but every time I change the path must reconnect the server?
I'm very sorry for my English.
|
|
|
|
|
Google it[^]. The answer is in the first result!
(I only looked it up because I'll be needing it too in a couple of weeks)
|
|
|
|
|
Hi,
Sorry if this is a simple question, I'm learning c# and I'm trying to send
a string to another computer, but when I receive the string I want to store that string in an xml file
the problem is that the string comes with "empty" characters at the end.
so my xml looks like "abc.........) follow by many empty chars.
here is the code I'm using to get the data. using tcp sockets
Byte[] received = new Byte[256];
int bytesReceived = server1Tcp.Receive(input, input.Length, 0);
dataReceived = System.Text.Encoding.ASCII.GetString(input);
How can I save the "dataReceived" string without the empty chars.
again, thank you to all of you who have helped me learn C#
-JC
|
|
|
|
|
Add this at below the posted code
dataReceived.Trim();
|
|
|
|
|
Trim the input, IIRC you get the full buffer length in string.
|
|
|
|
|
The way I would do it is to send the length of the string, and then the string itself. So you would have something like:
byte[] myBytes = ...;
int length = BitConverter.ToInt32(myBytes, 0);
string myString = System.Text.Encoding.ASCII.GetString(myBytes, 4, length);
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
nyjcr wrote: the problem is that the string comes with "empty" characters at the end.
No, the string doesn't come with any empty characters.
The problem is that you get the length of the actual data, but then you just ignore that and convert the entire buffer into a string. The unused part of the buffer just happens to be filled with zeroes.
Only convert the actual data:
dataReceived = System.Text.Encoding.ASCII.GetString(input, 0, bytesReceived);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi fellows, I want to develop an application that display a list of files that needs to be uploaded to the webserver through webservices. Each file is uploaded one by one to the webserver. Webservices read file bytes and create it on the webserver. so how can i be sure that file has been, 1) uploaded, 2)ceated successfully.
My second question is that transferring file one by one may slow down the process so should i transfer files in a package or is there a need to compress files first.
Thanks for answering
|
|
|
|
|
You can speed things up by compressing, sending one by one matters not a jot, the number of bytes is the same. Add a method you call to confirm that the file exists, or just have the web method return a bool to say that it wrote it OK.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Christian Graus wrote: You can speed things up by compressing, sending one by one matters not a jot, the number of bytes is the same
This is not 100% correct. Try sending >1000 (or any large number) files from one PC over a network to another PC (for example a shared network drive) and compare the speed with the same files compressed into a single one.
I'm not talking about compression here: the overhead for opening the files, creating the appropriate file handles and sending and receiving status commands (for FTP, e.g.) can decrease the throughput quite a lot. You can even notice the performance drop by simply copying many files from one harddrive (or partition) to another.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|