|
Thanks for the keyword 'Client Server (Network) Programming'. I searched in Google with 'Client Server Programming in C#' and found the VERY RIGHT article that just solved my problem.
Here is that article : Introduction to TCP client server in C#[^]
|
|
|
|
|
|
Find yourself some dictionaries with "known" words from various languages, and check if there's one with a lot of hits
I are Troll
|
|
|
|
|
I'm trying to determine is the value has already been encrypted so I don't encrypt it again.
Everything makes sense in someone's mind
|
|
|
|
|
Intuitively, I believe that this is impossible.
How would the function tell the difference between an encrypted string, and a string of random characters?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
It wouldn't. OTOH, how many people will decide to encrypt random data?
It'd be a lousy way to gain access to something that you don't know; it might even be an MP3-file in Base64 that's encrypted in there. Counting the number of hits against a dictionary is enough indication if you merely want to determine whether you're dealing with something in plain-text or not.
I are Troll
|
|
|
|
|
Me.
I frequently pad data before encryption with random info to ensure it is the same block size (say multiples of 8K). It makes it harder to work out any info about the source. Since my encrypted data includes the original length, I can just chuck the rubbish when I decrypt it.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
After a little experimentation I have noticed that there is one thing that might help you to determine this.
Only you can know if this is any help because you know roughly what sort of text is being encrypted.
Regardless of the input there should be no spaces in the encrypted text.
It's not foolproof proof, if you see what I mean, but it might help.
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.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
return ( true ) ;
Ah , just run it through again.
|
|
|
|
|
Kevin Marois wrote: I'm wondering if there's any way to determine if a string has really been encrypted from a method that's receiving the string and doesn't know what the unencrypted value is.
One way would be to explicitly add a prefix like: 'encrypt:' and 'plain:'
However you can also note that encryption creates binary values. Strings cannot contain binary values.
The algorithm that you referenced is returning the binary data encoded as base64. So unless your system is also passing around other binary data without specifying what it is then any valid base64 value larger than a certain length (say 20) could be considered encrypted.
|
|
|
|
|
Kevin Marois wrote: determine if a string has really been encrypted
If one could, then it would not be encryption would it?
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
No, not if the encryption algorithm is any good - it should appear to be random data.
However, when I write encryption stuff, I use a class which accepts a stream and returns a stream. The output stream includes the class ID and version (in human - and electronic - readable form) so that I can tell how to decrypt it. This allows for upgrades to "better" encryption algorithms without discarding existing data.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Hi,
I have used the Serial Port Class for around 2 years and not used the serialPort tool in the tool box. Is there a difference I have avoid it due to MSComm memories/flash backs in VS6 is there a difference why are two ways of doing the same thing included with .Net 2+?
Glenn
|
|
|
|
|
the components in the toolbox are regular .NET classes; using them through Visual Designer creates code in some (often hidden) file, look for file1.designer.cs; you can check the code and see your Form, all of its Controls, and the SerialPort being instantiated and their properties being set.
If you want to succeed in programming, you should not only be curious but also a bit more adventurous...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Well, thats that. I just had a way of doing serial comms to Windows and didn't need anything else I was interested, Yes you are right
this.RS232 = new System.IO.Ports.SerialPort(this.components);
I was expecting but no
using System.IO.Ports;
at all as a header on the form page a bit odd (give me #include ANSI C style anyday) .
|
|
|
|
|
Visual Designer avoids imports, as those may lead to name clashes, which would be bad when caused by imports you did not ask for; so they typically use fully qualified class names, as you discovered. Keep looking around!
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: fully qualified class names
As well it should... 
|
|
|
|
|
If you don't see it on the form, it shouldn't be in the tool box.
|
|
|
|
|
Hey guys,
I've created an application which I want to install on a server (Windows Server 2008 R2). I want the setup to run unattended and since the setup is being started from a Windows Service I cannot have any GUI components. Thus in fact, I want a silent setup. The MSI is here already. Executing is from a command prompt with the /? parameter, gives me a dialog window with all possible parameters. If I choose the /silent parameter, the software is not installed. If I choose the /passive parameter (unattended) Windows Server 2008 shows me a security box 'Do you want to allow the following program from an unknown publisher to make changed to this computer'.
How can I create a MSI file which fully supports silent installs on Windows Server 2008 (and Windows 7) ?
Thanks guys,
Eduard
|
|
|
|
|
|
Yes I Know that, as you read my question, the problem is that when the setup is running in 'silent mode', my software is not installed. It seems you have to have some kind of GUI in order to accept the UAC message. My question is if there is any way to get the setup going with automatic acceptance of the UAC message or something.
I understand there is no way to get rid of the UAC message, but maybe there is some kind of parameter accepting the UAC message (/q /uac=accept or something)...
|
|
|
|
|
I have a windows forms application.
I have a while(1) loop, which runs a Update Database functionality every 30 seconds.
There is Sleep(30000) in while(1) to wait.
This runs in background process.
Someone suggested me to use Windows.Forms Timer, while someone told me to use Threading.Timer.
My another requirement is that, i need to stop this background thread as whole on some UI tasks, so that Update Database functionality is not invoked at such times.
I require the suggestions to achieve same.
Thank You.
|
|
|
|
|
If it's a Forms application, you could add a Windows.Forms timer with an interval of 30000 msec, and do the update in its "tick" event. You then wouldn't need the while loop or thread sleep, and you can disable the timer as needed, preventing the activity.
Is there a reason to do your update in a background thread?
|
|
|
|
|
The application is pre-made by some other organization. I have to increase performance by doing necessary code changes.
he necessity for separate thread arises of UI not getting disturbed while execution.
But, as i see there is worst performance in application.Adding to it, local database is sql compact edition.
|
|
|
|
|
Do not use a Sleep command. This is the coding equivalent of summoning up a demon, and should be avoided at all costs. You are trying to run something at a periodic interval, so a timer should be your first port of call. If, however, your call is to happen 30 seconds AFTER the completion of the last call, then you may want to look at an alternate mechanism (although stopping and starting the timer may suffice for you here).
|
|
|
|