|
Finally someone noticed my brilliance! and I put it all down to knowing google!
|
|
|
|
|
hopingToCode wrote: I put it all down to knowing Kung Foo!
fixed it
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
how about...
^(0[1-9]|1[0-2])/[0-9]{4}$
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Regex:
\d{2}\/\d{4}
Code:
public static bool IsDate(string date)
{
return Regex.IsMatch(date, @"^(\d{2}\/\d{4})$");
}
|
|
|
|
|
Thanx Buddy you have saved my day.
Mninawa
|
|
|
|
|
From my side 5/5
|
|
|
|
|
You could always try a variation of this[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hello i need some experimented coder opinion about how to securise a c# server
1. i have a c# server listening public incoming soket on my computer (XP Windows)
so i have a port forwarded (86.123.xxx.xxx:666) in my gateway .
user are then able send me data . but i need know what are the risk of a such conection for my computer.
is there a way to block potential hacker attack?.
2.this server share (using soket) the IP with of all user (like a p2p machine).
what i want is encrypt the IP(s) in a XML and share the IP.XML with users.
i feel like it will not be hard for a hacker decrypt the IP.xml.
how can i max secure this stuff.
3.I know from my old programme experience that haker can read my C# code so
(like one of them(a friend lukily) success get my Sql password/user if i put it into the code).
how to well secure my c# code and make it not readable and where to put sensible string
like http://MydistanteSite/login.php or code for sql user =toto pass=123.
i feel like c# totaly unsecure rigth now may be i should switch lange for include sensible data in a public machine?
any security advise welcome^^
|
|
|
|
|
The .NET Framework has loads of Encryption classes. Use one of them.
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.”
|
|
|
|
|
Yess i know i encrypted ip in xml they look like this
<ip userip="xxxxMoooOOOO" <="" ip="">
but since .net encryption is well know i'm pretty sure haker have already theyr tool for decrypt that in a click i was hoping find something realy take a huge amout of time to decrypt so even when haker succes decrypte i can tell i win cuz i wasted
a month of his life^^.
i seen some tool on net for make c# source hard to read but no idea what is the best
or i can use all of them on an .exe.
making the code not understandable can help hiding that the .xml was even created on haker computer.
so for the opened port any danger?
|
|
|
|
|
The software you have seen is probably what is known as an Obfuscator.
Google for that word and you will get lots of hits. Most of the free ones would not deter a determined hacker but they would slow him/her down a bit.
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.”
|
|
|
|
|
ye i was reading on that look interesting i may even use both Obfuscator and
Salamander .Net Protector i seen this tool seem good enougth .
at this point my programme will not just worth the time to be haked.
now i need opinion how to securise my forwarded port from haker.
I don' realize well what a haker can do realy using an opened port.
think he can access my pc file (erase/download???) or again instal a trojan in my pc by sending soket?.
what protection i should think about
|
|
|
|
|
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.
|
|
|
|