|
evangile wrote: net encryption is well know i'm pretty sure haker have already theyr tool for decrypt that in a click
.Net contains support for a number of different encryption algorithms. All of which are publicly available, but this is not an issue. What makes the encryption secure is the Key(s) that are used along with the algorithm. Without those keys any hacker would have a hard time with decrypting the majority of the encryption algorithms in .Net - AES[^] would be a good option to go for... The main problem with encrypting data is where to store the encryption key(s)
What users to you intend to have this client application that would want to hack it for IP information anyway? Is it a public client application connecting to a private server? In my opinion letting them no what your IP address and port number anyway is not an issue. If they are sending data over the net them im sure there are tool they can use to monitor data being sent to and from there computers which would reveal you IP address anyway. Plus any good hacker could scan you live server for any open ports surely? Just make sure you have a good firewall set-up
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi All,
I'm just in the middle of a massive code review of some out-sourced stuff. And I need some new tools!
I've been using NDepend (amazing!) but this will only help so far. The application is based on Composite WPF so it's all loosly coupled meaning it isn't as simple as doing searching within Visual Studio.
I guess what I'm looking for is a tool that will allow me to search for text in a load of .cs files (maybe even XAML) within a directory tree.
Are there any tools out there with this functionality?
Cheers,
|
|
|
|
|
I hesitate to make recommendations but if you do a google for desktop search you should get plenty to try.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
on UNIX you had grep and awk but don't know the equivalent on PC and I havn't used them for years!
and out of interest what does this have to do with c#?
|
|
|
|
|
I don't know if I understand you entirely but is Winmerge what you're looking for?
|
|
|
|
|
Visual Studio can do a "find in files"
|
|
|
|
|
Hi all,
Recently i got stuck up with a problem. Am developing a small console application which uses the web services offered by another server!
Now i want to add a custom http header( not SOAP header) to each and every web service call made from the client!
it may look like
POST / HTTP/1.1..
User-Agent: Mozilla/4.0 (compatib le; MSIEMS Web Services Client Protocol 2.0.50727.3082)Content-Type: tex t/xml; charset=u tf-8
SOAPAction : ""
Authorization: Basic UjhDT Ek6
MY header
Host: 192.1 68.70.99:1984
Content-Length: 453
now how do i add, custom http headers to every calls.....
Have a Happy Coding.....
|
|
|
|
|
Have a look at this[^] maybe it will help?
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Hi Kwagga.... Thanks for your reply!!
Its an article on creating SOAP headers for WSE3.0, whereas i need HTTP header for general web service call.
Thank you again for your kind reply....
Have a Happy Coding.....
|
|
|
|
|
I have these code:
protected bool EEWrite(UInt16 Address, byte Size, object[] ByteData)
{
bool Status = true;
object[] Data = new object[4 + Size];
Data[0] = SerialNumber;
Data[1] = (byte)0x80;
Data[2] = (UInt16)Address;
Data[3] = (byte)Size;
for(int i = 4; i<=4+Size;i++)
{
Data[i] = (byte)ByteData[i - 4];
}
Status = Device.Write( Data);
return Status;
}
Then i 'd like to write a float number write_number as below:
Status = EEWrite(0x9021, 1, ByteData);
How would i convert a float write_number into ByteData?
Thanks !
|
|
|
|
|
object[] byteData = BitConverter.GetBytes(write_number);
I think that is what you want.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
the code have error:
cannot implicitly convert type 'byte[]' to 'object[]'
|
|
|
|
|
then assign in to a byte array and then if you need that as an object array loop through the byte array and pass each one to an object array.
byte[] ba = BitConverter.GetBytes(write_number);
object[] oa = new object[ba.Length];
for(int i = 0; i < oa.length; i++)
oa[i] = ba[i];
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hey, I'm trying to create a program that would figure out how many times to fold a sheet of paper to get to the moon using recursion and I'm getting a Stack Overflow Error, any thoughts?
const float PageWidth = 0.1F;
const float distanceToMoon = 380000000000;
static void Main(string[] args)
{
Console.WriteLine("You have to fold the sheet of paper " + Moon(1) + " times to get to the moon");
Console.ReadLine();
}
static float Moon(float times)
{
return ((times * PageWidth) > distanceToMoon ? times : Moon(times+1));
}
|
|
|
|
|
Okay, here goes:
0. The stack has a limited size, and every time yoou call the method Moon there is another call on the stack.
1. You are making a shed load [technical term] of recursive calls.
2. Your function will return the distance and not the number of folds.
3. You can only fold a piece of paper seven times.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
williamnw wrote: 3. You can only fold a piece of paper seven times
Regretably, this turns out not to be the case.
Paper_folding[^]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
talk to the hand
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Thanks for your answer. Though:
0. The stack has a limited size, and every time you call the method Moon there is another call on the stack.
Is there something wrong in the algorithm then? Because it's an assignment. If they proposed it I guess it's doable.
1. You are making a shed load [technical term] of recursive calls.
I have to use recursiveness... Not sure what you mean with this one.
2. Your function will return the distance and not the number of folds.
What makes you say this?
3. You can only fold a piece of paper seven times.
Let's suppose it's an imaginary super huge paper that never ends.
Thanks for your answer
|
|
|
|
|
Every fold should DOUBLE the width; i.e. 0.1, 0.2, 0.4, 0.8, 1.6, etc
I mis-read and if your iteraction got there it would return the value.
Try an algorythm the other way:
TimesToFild (paperWidth)
if paperWidth >= distanceToMoon
0 folds needed
else
1 + TimesToFild (paperWidth * 2) needed
Start with a shorter distance say 3 and check your function.
Don't use floats, go double.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hi,
you called the function Moon too many times. Try it using e.g. distanceToMoon = 380, then it will work.
You should use e.g. a for loop.
Kind regards
|
|
|
|
|
Shorter distance or lop, the algorithm is wrong!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
It's because you are not folding the paper at all, you are just stacking papers on top of each other.
When folding a paper the thickness will double each time, you are just adding a single sheet of paper each time.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi, thanks for your answer. I hadn't seen it that way. But, are you sure the paper's thickness will double? The first time you do it, sure, but the second time in my head the paper's thickness will be three times the thickness at the beginning, isn't it like that?
|
|
|
|
|
No, the number of layers will double each time.
Try it out with a piece of paper. Fold it once, then again. Count the number of layers that you have, and you see that it's four, not three.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Why do you have to use recursion at all? I'm fairly sure you could use a logarithm to get a better answer, then round it up
x = by
y = logb(x)
380000000000 = 0.1n-1
n-1 = log0.1(380000000000)
n = log0.1(380000000000) + 1
Something like that should do the trick (although I'm rubbish at logarithms, so this might give you the wrong answer, the method should be okay)
|
|
|
|