|
Well, it is in the "System.Windows" namespace. I definitely think the annoying OS-specific stuff should be wrapped and be made available in the .Net Framework. That provides a layer to help avoid changes when the underlying OS changes. So in Windows 8 we can use the same .Net functions. If the functions no longer exist on that OS, they can perhaps throw an exception and having a bool that says IsFeatureAvailable would be nice too.
|
|
|
|
|
Yeah, OSes are pretty much a shell game.
|
|
|
|
|
|
How else do you legitimately access those features?
|
|
|
|
|
Trollslayer wrote: How else do you legitimately access those features?
Hmm, you are right. Anyway it must be placed somewhere or we are back to interop.
The best place for that would be a 2nd party .NET library -- not in the framework itself. The same with GDI/WPF. Who uses both GDI and WPF? If GDI was in a separate lib from the beginning there wouldn't such a mess today. A designer would choose a technology for GUI and data storage and wouldn't have to reference all former/future technologies. But this is just my opinion.
Ouch. Kombadibilidy.
Greetings - Jacek
|
|
|
|
|
Found this great code for encryption in our codebase. All of the client's extremely sensitive information is being stored locally using this.
string Encryption::EncryptString(string dat) {
string n = "qwertyuiopasdfghjklzxcvbnm"
n += n + n + n + n;
for (size_t i = 0; i < dat.size(); i++) {
dat[i] ^= n[i];
}
return dat;
}
And it gets even better when you see the decrypt function:
string Encryption::DecryptString(string dat) {
return EncryptString(dat);
}
|
|
|
|
|
Superb. Microsoft should remove the System.Security.Cryptography as soon as possible.
|
|
|
|
|
Question: I use another keyboard layout. Will it still work?
However, this is a good encryption function - only the first 130 chars will be encrypted with a known key...
|
|
|
|
|
Oh Horror of Horrors... This one is certainly one of the best. I don't think it could have been any worse if it had been written in vbscript.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
That is a truly brilliant encryption strategy, I will have to use it the next time I need such a thing.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
I have tried your suggestion for encrypting and decrypting but it keeps giving me errors when I try to play the code.
I really need this to work ASAP as it is a very important project for me!!!
return 5;
|
|
|
|
|
It looks like some urgentz univoters didn't get it.
PS. I had considered voting you up but I found these two uni-votes funnier than the content. Sorry
Greetings - Jacek
|
|
|
|
|
As long as you hide the key well, and use it only once...
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
You know, this function is so great that it will crash the application if "dat" is long enough (longer than 130 symbols).
|
|
|
|
|
I was getting some weird compiler errors and spent about half an hour trying to figure them out. Long story short, this will not compile in ASP.Net:
<%@ Page Language="vb" %>
<script runat="server">
Protected Sub Test()
Dim s As String = "</script>"
End Sub
</script>
Without opening Visual Studio, any guesses as to why it doesn't compile? I've already figured it out, but I don't want to spoil the surprise.
|
|
|
|
|
Is it because Visual Studio has realised the stupidity of VB and now only compiles C#?
return 5;
|
|
|
|
|
Weak...
|
|
|
|
|
Interesting choice of words
return 5;
|
|
|
|
|
TBH I had to put it in VS. Seems like a bug in VS right?
return 5;
|
|
|
|
|
Yeah, I was thinking of reporting this to Microsoft Connect. Seems like a bug in the parser.
|
|
|
|
|
They could really do with a good review of the asp editor in general. it is very annoying how it formats code when you start using if/else statements.
Also, something like the following causes warnings (even if it is bad coding)
<div>
<% if(true){ %>
It is true I tell you!</div>
<% } else { %>
You will never here from me!</div>
<% } %>
return 5;
|
|
|
|
|
What warning does it give? I would think it's a good thing that it warns you of unreachable code.
|
|
|
|
|
Sorry. Bad example. The warning I mean refers to unmatching div tags
return 5;
|
|
|
|
|
Oh, I gotcha. Yeah, that is annoying. I usually use an asp:Literal tag to get around that.
|
|
|
|
|
I found this on my friend's source code, I wonder the intention of this function ....
He create a function on an Oracle database.
<br />
FUNCTION f_init<br />
RETURN VARCHAR2<br />
IS<br />
vssqlerrm VARCHAR2 (255);<br />
vsvalidation VARCHAR2 (255);<br />
BEGIN<br />
vssqlerrm := '';<br />
vsvalidation := '';<br />
RETURN vsvalidation;<br />
EXCEPTION<br />
WHEN OTHERS<br />
THEN<br />
BEGIN<br />
vssqlerrm := SQLERRM;<br />
vsvalidation := vssqlerrm;<br />
END;<br />
END;<br />
It's easy to laugh, but, it's so hard to smile ...
|
|
|
|