|
Hi David, I'm debugging remotely if you consider the computer sitting 6 inches to the left of my development system remote.
From what I understand (and have done) since reading Atul's message is that you can debug locally if you have installed VS.NET after you installed IIS etc as it adds debugging support, however, as in my case, you need to run the STEP 1 of the vs.net setup on the remote IIS server, then do STEP 2 of the VS.NET setup selecting only the server / remote debugging components which takes care of all that. (it's in the readme file for VS.NET installation).
(Although you may already know all this;))
|
|
|
|
|
i have set up a new member of the RC2CryptoServiceProvider. im trying to enhance the security of my program further by generating a random saltbyte using the RNGCryptoServiceProvider class. it works fine to generate the random file in a byte using the following code :
byte[] random = new Byte[100];<br />
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();<br />
rng.GetBytes(random);
my question is...i can encrypt with this method and random salt bytes...but since they are random how can i call apon them when decrypting ? if you dont decrypt with the same bytes then you get a encryptiong "bad data" error. how can i safely get the bytes used for encrypting to my decryptiong method.
im trying my best to make a clear question out of this problem if it wasnt clear enough let me know and ill try to clearify.
thanks alot,
Jesse M
P.s furty i know you know the awnser...
The Code Project Is Your Friend...
|
|
|
|
|
The simplest way would be to have a fixed salt byte array of course, however the next easiest option would be to write the salt bytes to your filestream when encrypting, and read them back when decrypting.
Encryption:
FileStream fs = File.Create(filename);<br />
byte[] salt = new byte[16];<br />
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();<br />
rng.GetBytes(salt);<br />
fs.Write(salt, 0, salt.Length)<br />
<br />
Decryption:
FileStream fs = File.OpenRead(filename);<br />
byte[] salt = new byte[16];<br />
fs.Read(salt, 0, salt.Length)<br />
<br />
While this is certainly not the best method of doing it, it will work fine. Ideally your salt bytes would also be encrypted, so as not to weaken the basic thing they're about. But then again, your IV should be unique and encrypted too, and you should be using a keyed checksum, and etc etc.. OK, I'll write an article and put together a wrapper for it all *when* I get a few hours free time.. For now this will get you by
|
|
|
|
|
thanks alot for the help...i will use a filestream...write the salt bytes...then encrypt the salt bytes....so on so forth.....or i guess i could just make a dll to do it for my program too....
The Code Project Is Your Friend...
|
|
|
|
|
How can Controls(Buttons, Panels, etc..) be passed by referenece without making an overload for each type of Control. When trying to pass a button control an error is recieved of :
cannot convert from 'ref System.Windows.Forms.Button' to 'ref System.Windows.Forms.Control'
Trying to cast this does not work, and as said before making an overload for each control type seems a little massive. Every control made after this will have to be added to the code and then recompiled.
|
|
|
|
|
have you tried boxing the button to a control when you call the method?
MyMethod(ref (Control)myButton);
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
There should be someother way of doing it(something seems to be wrong here, but I couldn't figure out), but did you try passing ref Object
Cheers,
Kannan
|
|
|
|
|
Why why why? object is by ref all ready!
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
First, you only need to pass an object by reference if you are changing the object reference. If you're only changing properties or calling methods on the object, you should pass it by value.
When you pass a variable by reference (ref Parameter or out Parameter ), the variable type has to match precisely. For example, the following code would attempt to assign a Textbox to a Button variable:
void Test(ref Control c)
{
c = new Textbox();
}
...
Button b = myButton;
Test(ref b); The simplest way to pass an object by reference to a function which expects a base class is to use a temporary variable of the correct type. Downcast the actual object, call the function, and then try to upcast the variable back to the object:
Control temp = (Control)myButton;
Test(ref temp);
myButton = (Button)temp; In this case, if anything other than a Button (or a class derived from Button ) has been assigned to the reference variable, you will get a runtime error.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hey folks,
I am working on a multi-threaded windows app and I have run into a bit of a design snag. I’d like to follow a MVC type of design as much as possible; so I want to separate all of the business and event handling logic from the form.
To do this without passing references to controls and forms all over the place, it looks like a Mediator is the sure fire way to go. But, the downside of the classical Mediator is that all the controls must extend (or implement) a “Colleague” base class in order to be aware of the Mediator. I really don’t want to have to subclass every possible control that I might use.
Does anybody have some insight to share on this one? Is there another approach that I am missing?
[edit]
An idea I have is to implement the Mediator using an Observer to force the UI to update in response to events.
[/edit]
TIA
Chris
But I, being poor, have only my dreams.
I have spread my dreams under your feet;
Tread softly, because you tread on my dreams.
- Yeats
|
|
|
|
|
try using an interface.... IColleague
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
try using an interface.... IColleague
Thanks for the input Philip.
I was actualy trying to avoid implementing an interface as I was hoping to be able to just use "any old" control. But, it looks like using an interface or reflecting the controls may be the two most reasonable approachs. I'll probably whip up a little test app today and see how I like the two approaches.
Thanks again.
But I, being poor, have only my dreams.
I have spread my dreams under your feet;
Tread softly, because you tread on my dreams.
- Yeats
|
|
|
|
|
Chris Austin wrote:
To do this without passing references to controls and forms all over the place
IMHO interfaces, reflection, virtual methods and event subscriptions are helpful in this area. And quite honestly there is nothing new compared to what we already have with C/C++.
|
|
|
|
|
IMHO interfaces, reflection, virtual methods and event subscriptions are helpful in this area.
After a night of not thinking about it I arrived at almost the same conclusion. If i want this the be in any way flexable I will probably need to use reflection.
And quite honestly there is nothing new compared to what we already have with C/C++.
Can't disagree with you there. Just trying to learn a new tool.
Thanks for your input.
But I, being poor, have only my dreams.
I have spread my dreams under your feet;
Tread softly, because you tread on my dreams.
- Yeats
|
|
|
|
|
I am looking for a .NET grid product that has the following features...
1) It works with the IDE and you modify the grid using properties.
2) It supports ADO.NET
3) It is basically a small set of files and doesn't require you to download the entire SDK
4) They have some C# samples.
5) They have a free download so I can try it out.
Surprisingly, I've downloaded 5 demos so far and none have come close to doing half of these features.
Thanks!!
|
|
|
|
|
psdavis wrote:
1) It works with the IDE and you modify the grid using properties.
have you tried the xceed grid? http://www.xceedsoft.com[^] its design time support kicks ass.
psdavis wrote:
3) It is basically a small set of files and doesn't require you to download the entire SDK
umm....i think ur gonna need the sdk if you wanna program in .NET.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
|
Our company uses Infragistics (http://www.infragistics.com[^]) WinForms controls, and so far, we are quite happy with their quality. Infragistics also has several WebForms controls, including a grid control, but we did not explore them yet.
Alexandre Kojevnikov
MCP (SQL2K)
Leuven, Belgium
|
|
|
|
|
Hi Pal,
This is absolutely Right! I have been working on Infragistics Control library for a long time now! The libraries are available for both Windows as well as Web Applications with several controls which were not available easily before! It provides the UltraGrid control which is the Best Grid I have ever seen in my Life! It has tremendous support for customization. Trial version of it is available from the Sitespecified above.
i.e. Infragistics.com
One of the most important things is that Microsoft itself has given them a lot off support during the build! (At least that's what I learnt).
Yeah, one more thing, On purchase, they provide an excellent Service!
I think you must go for this!
regards
Atul Kale
MCSD, MCT
Sr. Software Engineer
XcelVision Technologies Ltd.
|
|
|
|
|
Hokay Dokay....
I have an MDIParent with a controller window on the side. The controller window creates the instances of the MDIChild forms and defines the MDIParent as the parent of the children. So far so good. All works just dandy -- including managing multiple instances, etc.
Now -- the next enhancement to the app. I need to do processing on the children AFTER they have been created. What I want to do is this:
Delegate an event in my parent form to do the after-creation process.
Have my children raise the event once the form has been loaded.
The question is this: Is there a GOOD existing event I can use to accomplish this that guarantees me that only the children raising the event will trigger the event, or should I define my own event to handle it? I want to make sure that normal window process does not fire this event since what I have to do is rather intense processing!
I was thinking of reusing the CollectionChanged event since my parent is not databound there should be only the intentional firings from my children. Any suggestions ???
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Hi there,
There u got one more Problem in the Forms library . Microsoft has provided enough of Collections almost everywhere possible, but they forgot to make the MDIChildren as a Collection. Unfortunately it is an Array!
So, CollectionChanged etc. is not helpful at all! You have to go for creating your own events for managing the Pre and Post creation processing of ur Child forms.
However, i would like to mention one thing that, default event processing would be synchronous. You may look at using Application.DoEvents method or use a new Thread for performing the processing to make it asyynchronous.
hope this helps!
Atul Kale
Sr. Software Engineer
XcelVision Technologies Ltd.
|
|
|
|
|
I've modified code to display IDE like menu items in FoldersTree(by Carlos H. Perez) context menu.
Each item is newly created menu item with a same system ID and a picture if any was. All it happens when Popup is about to be displayed. Cat't attach picture to this message... I had to do this because of standart menu items under Windows 2000.
if anybody interested, email me to aprokudin@bgs.ru.
Alexei Prokudin.
BGS SmartCard Systems A.G.
Moscow, Russia.
|
|
|
|
|
I found some solutions for adding icons to MenuItem and get them in contextMenu.
i have overriden MenuItem class OnDrawItem and OnMeasureItem and the constructor.
if i try to display it as MainMenu ContextMenu or ListView ContextMenu it works fine, but if iam going to display this in NotifyIcon it just leave the ContextMenu Blank.
i looked the whole day for some solution to this problem but it just dont work with DLLIMPORT "user32.dll" and some other tricks
if someone knows how to do this please help me i need to set up this project till friday so come on guys code ....
thanks a lot
|
|
|
|
|
try the magic library....they have a really cool menu that has alot of features built into it... http://www.dotnetmagic.com/
they have a PopUp window that works by the mouse X and Y you can with a little bit of code get this window to Pop apon clickin on the notify icon...
Good Luck
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
thanks a lot i got it with popup & menucommand ! then i imported user32 and got the mousex and mousey position so its able to get icons into the systemtray context menu .
great idea thanks again
|
|
|
|