|
A quick suggestion here would be to use windows messaging. The SendMessage API in windows..But for this you need to know the windows handle..Since it is in a same machine .. this technique will be the easest and light weight way. than going for tcp
http://www.codeproject.com/KB/dotnet/VB6andVBNETWindowMessages.aspx[^]
modified on Friday, February 27, 2009 2:34 AM
|
|
|
|
|
I would suggest a different approach, as it is obvious that TCP channels are wasteful when the two applications run on the same machine.
There's an article I wrote which explains how to do IPC in C#.
It's not the main purpose of the article, but you can use it to get ideas...
It's called A Pure .NET Single Instancing Solution[^]
Good luck...
Shy.
|
|
|
|
|
Thanks a lot.
It is the best solution that i found. I will try on it later when i finish other feature.Thanks.
Regards,
PeiYang
|
|
|
|
|
Hi,
I need to do drap and drop in virtual mode.
1. I use virtual mode to display large number of contact in icon view in my application.
Currently my application need to support drag and drop. I can't found any solution. Is that anyway to do so?
2. If i want to drag and drop a list to any location (not align to grid), how can i implement it?
Hope some one can help me to solve this problem. If can provide me some example to refer.
Thanks.
Regards,
PeiYang
|
|
|
|
|
I need some help in the final year project.Can somebody give me the idea of dynamic content generation in C#.
Can somebody also tell me how to search a topic from a book which is in RDF format and generating a book(here by book, i mean definition, explanation and exmaples...) of the topic i am searching. The algorithm i am working on should perform following steps:
1 Parsing the file(RDF)
2 Forming Semantic structure(graph)
3.On the basis of some reordering algorithm, generating the text out of the graph
Can you please guide me how to perform these steps in C#.Please help me....
|
|
|
|
|
Sounds like a lot of work. You have a year to get this done tho, right ? So, start by doing some research on the RDF format, and then consider how to turn that data into something you can build a graph from.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I am trying to complie using devc++. I have error on this line :
FILE * d , * m , * fopen();
any help?
Thanks
|
|
|
|
|
I think you posted in the wrong forum, this is C#.
And its probably because you cant have the function fopen() as a variable.
I'm also not so sure you can make pointers on the same line like that either, but I've never tried.
My current favourite word is: Delicious!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Adam_Omer wrote: any help?
Yes: buy a Sat Nav.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
mobius111001 wrote: I want to create a COM object that I will expose to 3rd parties.
Hum, interesting... What has it to do with the C# forum?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Where else should it go? Does it count I'm writing the COM object in C#?
|
|
|
|
|
mobius111001 wrote: Does it count I'm writing the COM object in C#?
Yes, indeed: you lost 100 man points for doing it that way.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: What has it to do with the C# forum?
He can't tell you that silly, you don't have proper security clearance. 
|
|
|
|
|
You guys are evil. Funny as hell, but evil nevertheless
|
|
|
|
|
Did you seem my reply in the ASP.NET forum? 
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Do they requirements specify how strong the encryption needs to be?
The requirements are unrealistic. It is in fact impossible without relying on user input*. You can use encryption of course, but it will not do anything besides wasting valuable resources. It will bar only the worst pseudo cracker that dares call himself/herself a cracker - and those are not the people that the company should be concerned about.
It's impossible because this is not a communication-channel you're trying to protect (where evil Eve only has knowledge about the communication itself), this amounts to trying to protect static data. It's impossible. Even if 3rd party programs have to use a "secret" key. They key is not secret, because the 3rd party program can access it. Thus, so can anyone who has the 3rd party program. Even if it has to, for example, use yet an other key to decrypt the real key. Or a 3rd key to decrypt the 2nd key. Somewhere it will end in a piece of data that is readily available to anyone.
That leaves you with user input - that is, requiring that 3rd party software do not store the key inside itself, but asks the user to input it. Sure the users could leak it, but at least the data itself doesn't contain its own key.
However, and this is a much bigger problem, the very thing you're trying to protect with such heavy locks is still unprotected. That is, to use it directly requires opening the locks.. but what's to keep anyone from dumping the locks? Decompile(.NET - obfuscators will not stop real crackers)/disassemble(native) the dll, delete the encryption code, and recompile/re-assemble..
The only people you'd successfully protect from, are people from which you have little to fear.
|
|
|
|
|
Hi all,
I am having a little trouble with Regex.
Basically i have a text file that i am trying to parse.
In this file i know there will be a number of names, these names will always use 100 bytes of space, if the name, in plain ASCII code, is less then 100 bytes the remainder of the space is filed with 0xFF
My regex code is as follows.
streamreader sr = new streamreader("file.txt");
string text = sr.ReadToEnd();
sr.close();
string pattern = @"[A-Za-z0-9]|\xFF{100}";
Regex = new Regex(pattern);
foreach(Match match in Regex.Matches(text))
{
}
I think the problem is with the \xFF part of the program, as a simple regex expression such as @"\xFF" returns no where near as many 0xFF values as are present in the file
Thanks for any help
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
How about something like:
@"[A-Za-z0-9\xFF]{100}";
(Untested)
And about whitespace?
|
|
|
|
|
thanks for your reply,
I have tried your suggestion too and get the same results. white space characters in addition to basic symbols may be present but for now im just looking to get this one working as i am certain the HEX value is what is causing me problems
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Hi,
ReadToEnd reads data as text, i.e. it applies an encoding to interpret the bytes and returns a Unicode string. Are you sure your text still holds characters with the value \u00FF?
I suggest you print out a few hundred chars in hex and check.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:43 AM
|
|
|
|
|
Oh, yeah, I hadn't thought of that.
|
|
|
|
|
Thanks Luc, correct as allways
Printed the chars out as ints and found they where much higher than i was expecting. the thing i found unusual thou, atleats in my opinion, was that FF became 65333 as did a number of other Hex values over D8 (maybe lower values but i didnt see any others)
is there any reason why FF should not translate to 00FF?
Anyway my resulting modification was to loop the BaseStream and use a string builder with each byte read. works just as i expect now
While on the subject. Do you know if it is possible to perform a Regex search on the file itself?
i understand that a full string is required to ensure patterns are not split but it just seems bad to load the whole file into memory, even if its small in relation to RAM.
Initial i had my own file search that used keyword that allowed wildcards directly with the BaseStream, but this only works when there are contant values to identify.
I would have a keyword class and a method that takes a byte value, if that value matches the keyword at index 0 it incremets a counter so the next byte passed in is checked against index 1. if the count equals the keyword length then the function returns true (a match) then i can process.
I just think it would be good for regex to have a similar option because at the minute i can not handle a progress bar update until the regex has found matches. Possibly regex was not meant for file searching and more for validation of string values.
Anyway lol, thanks again
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Hi musefan,
whne you read text from a file, an encoding is used; you can specify one explicitly, most methods (e.g. File.ReadAllText) allow you to specify one; or you get your system's default encoding implicitly, which depends on regional settings.
I expect the regional setting ("code page") to be such that a lot of special characters get encoded in the byte value range [0x80, 0xFF], in order to save bytes in a file (and make it region-dependent!).
As an example, in Western Europe the default code page is 1252, which puts the Euro sign at 0x80, although there also is a Unicode character for it (0x20AC). So by default, reading a file containing 0x80 will result in a string with a 0x20AC at that position.
No, Regex does not work on files or streams, it needs a string.
No, progress indication is not really possible when you ask for a bulk operation such as File.ReadAllLines, a Regex operation, an SQL database operation, etc. Progress indication is available only when you implement it, which implies there are many steps in the job, possibly forcing you to cut the job in small steps (and forego the big methods such as ReadAllLines, and all Regex stuff).
I'm not a very big fan of Regex for your needs, I would have coded that with direct byte or char manipulations on the stream. Not sure whether I would chose bytes or chars though, probably bytes since your file does not really qualify as text, due to the 0xFF stuff.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:43 AM
|
|
|
|
|