|
it is,..encryption / compression namespaces/classes (rsa,tdes,rc2) and a listener class and a recieving class. I just dont know what type of object to send. I want my program to be secure as in...the use is notifyed that someone wants to send a list of there files, I want the other user (requester) to recieve a encryption key that only they can use to encrypt those files. i have that working and all but i was wondering if there were any examples anywhere on how other people accomplish such a thing ?
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
Do you mind if I ask why you aren't using .NET Remoting?
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
Well i found from school that using .net remoting can do the samething but i want the raw power of sockets. knowing who is connect when/where/there IP, i assume you can write this into all of your objects and do the same with remoting, but why re-invent the wheel ? and for some reason even though i spent alot of time with remoting in school i seem to beable to use Asyncronous Sockets alot easier, they just make sense to me. And i have alot of power on how i recieve the objects, for example..in my recieving callback i have a stream write the recieved bytes to a file so it doesnt hog up my memory while it waits to download all of the object. This saved alot of memory because sending files encapslated in a class are very large, my socket recieves every connection and give it a unique output and saves the reieved bytes to that output. The unqiue output dir is saved in my state object in my recieve callback and i just reuse that same state object the next time around. Once the object is fully downloaded i move on and decrypt the saved bytes, decompress / reserialize, and the other user recieved it fine. Deep down inside the remoting calls uses sockets as well...although the remoting classes are more user friendly and by all means not dumbed down at all. (it also generates the sockets for you on the fly...which is awesome)
Jesse M.
The Code Project Is Your Friend...
|
|
|
|
|
I've read up on Relection.Emit and its uses and am amazed at the flexability. But, I'm wondering if it will do more. First, I declare Dynamic Assembly using the current running assembly. I can now add members to the assembly and even switch out a method body using the MethodRental class! But, is it possible to remove members from an assembly or class? What about adding or changing members to an exising member in the assembly? Is this in any way possible, or would the entire assembly or module have to be created from scratch?
|
|
|
|
|
I reckon you have just about reach the limits of Reflection.Emit. MS has a project called the CCI (Common Compiler Infrastructure) but it is not public and they couldnt tell me when it would be.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
CCI is a Microsoft Research thing rather than a MS Corporate thing. Here's a powerpoint presentation about it. I'm fairly certain this library has be shared with the P7 folk working on other various compilers for the .NET platform.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
|
Very tantalizing, but quite a ways before it's generally available. I'm guessing that's what CCI has morphed into.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Please be kind if this is a foolish question or has been discussed ad nauseum, but I can't find it and I don't get it.
As a dyed-in-the-wool C++/MFC programmer, I now have to start usign C#, but of course new programs I write still have to interact with existing C++/MFC programs. The existing C++/MFC programs communicate with each other through Windows messages (mostly WM_USER + xxx, but also sometimes just sending a WM_CLOSE to close each other). They ALSO communicate internally to a given process among threads by using PostMessage() and PostThreadMessage() with user-defined messages.
So, to my questions:
1) Is it true, as I've read in several places now, that the only/best way for a C# application to receive a Windows message is by overriding WinProc? That seems hideous.
2) Is it true, as I've also read, that the only way for a C# application to send a Windows message to another application is by P/Invoke of SendMessage()?
3) Finally, for the communication between threads or windows of a given process. I realize that I can call functions back and forth, use delegates, or whatever, but (pardon my ignorance), that seems very synchronous and painful compared with being able to call PostMessage() or PostThreadMessage() and not have to wait for the receiver to process the message. Is there a better way?
Thanks for any advice.
|
|
|
|
|
larrywph wrote:
1) Is it true, as I've read in several places now, that the only/best way for a C# application to receive a Windows message is by overriding WinProc? That seems hideous.
From what I've done of Windows Programming the answer is yes. Why does this seem hideous to you? Overriding a function seems fairly clean.
larrywph wrote:
2) Is it true, as I've also read, that the only way for a C# application to send a Windows message to another application is by P/Invoke of SendMessage()?
seems like it
larrywph wrote:
3) Finally, for the communication between threads or windows of a given process. I realize that I can call functions back and forth, use delegates, or whatever, but (pardon my ignorance), that seems very synchronous and painful compared with being able to call PostMessage() or PostThreadMessage() and not have to wait for the receiver to process the message. Is there a better way?
Not exactly sure what you're going for here. Perhaps you can provide an example so we can better understand your problem
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
I'm calling a DLL method that has an LPTSTR parameter which may come back with embedded NULLs. After calling the method, I need to parse this parameter and extract the individual "words" into a string array:
[DllImport("myDll")]<br />
public static extern void GetMyWords(StringBuilder result, int size);<br />
<br />
public string[] GetWords()<br />
{<br />
StringBuilder sb = new StringBuilder(1000);<br />
GetMyWords(sb, 1000);<br />
return sb.ToString().Split(new char[] {'\0'});<br />
}
The problem is that the result is somehow truncated after the first word. What should I do to prevent this from happening?
Thanks!
Alvaro
Can I ask you a question?
|
|
|
|
|
Using C#,
How would I refresh the desktop? Say I created a shortcut and it did not show after creation, or if I programmatically changed the desktop path in the Registry and would not appear to change until I logged in again. I want to make these changes appear immediately.
Thanks
Rob
|
|
|
|
|
Just guessing that you are using a windows based OS, the best way i can think of is searching for the correct api call on microsofts website (msdn) then make that call. Your can call the graphics object that draws the desktop and tell it to refresh..but i dont think this would fix the problem. Hope this Helps.
Jesse M.
The Code Project Is Your Friend...
|
|
|
|
|
Thanks,
Yeah, the api calls are weird though because they refresh specific desktop items only like wallpaper, screen, but do not address the path of the virtual folder and items within it. I am sure I will get to the right one.
|
|
|
|
|
Im wondering if one of those calls to the api that refreshes (say the wallpaper) also refresh's other things like links and icons ect.
Jesse M.
The Code Project Is Your Friend...
|
|
|
|
|
I'm working on a program to store my DVD collection, download the cover images, etc. I know programs exist to do this already, but I needed a project to learn C#, so this is it.
I've run into a logic problem when downloading Cast/Crew data from IMDB and storing it. My project uses an XML file to store the collection data, in this format:
<owned>
<movie>
<rating>R</rating>
<id>12345</id>
<title>Movie Title</title>
<year>2003</year>
<length>122</length>
<cast>
<star id="12345">Some Guy</star>
<star id="54321">Some Girl</star>
</cast>
</movie>
</owned>
Right now everything but the <cast>...</cast> information is parsed and stored in a ListView control, which works fine. The problem I'm having is how to store the data so that I can click on a person and see all the movies I have with them in it.
In a language like PHP I'd do an array of arrays with associative key => value pairs, like
Stars = array(
'Star ID' => array(
'Movie ID' => 'Movie Title',
'Movie ID' => 'Movie TItle')
);
And the equivalent in C# seems to be a hashtable, but it won't let me do Hashtable[Key].Add(ID, new Hashtable())
So I guess what I need a multi-dimensional Hashtable? Does anyone get what I'm talking about?
|
|
|
|
|
Why not load the data into a dataset? Once it is in a dataset you can apply filters to limit which rows are displayed. Populate into three tables, one table of movie data, one table of star data and one relational table that ties stars and movies together.
|
|
|
|
|
I like Daniel's suggestion of using a DataSet - there's a lot you could do with it if you chose to use it.
Otherwise, you may want to look at the NameObjectCollectionBase from the System.Collections.Specialized namespace.
|
|
|
|
|
DataSets look good, thanks guys.
|
|
|
|
|
I have a relational Access DB and I am wondering if there is any way to get the schema of the entire database and write it in XML. The second thing I am trying to find out is if it is possible to export the XML schema from this Access DB as an Oracle Script that will build an oracle database with the same relationships as my existing Access DB. Thanks for your help, you guys are lifesavers!
Frank
|
|
|
|
|
look at the Data COmmandBuilder classes, should provide the schema for u, dunno about oracle as u need a phd (and a small atomic powerplant) to work with it.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
For our Beta builds, I need to run a command line program just before building the main assembly. Yet the only pre-build setting I can find runs it for ALL configurations.
(I modified the utilities in question to accept a parameter of $(configuration name). Of course, this means the utilities have to now be build and for all configurations. Who's the idiot who came up with this limitation?)
Joe Woodbury
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
|
Good idea. Thanks.
Joe Woodbury
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
I would like to know if there is any built in function/library in C# which lets me solve the foll. Statistical problem:
Given the mean and the variance of a normal distribution, I want to get the sample points that are arrived at based on the mean and variance.
(Basically some function similar to the Worksheet function NormInv in MSExcel).
Right now I am doing a very kludgy solution where I create an Excel Worksheet function object just to access the function. This makes my application real slow. Moreover I need this type of evaluation to be done possibly 10,000 times as I am developing some kind of a simulator.
Anybody please help !!!!
|
|
|
|