|
I don't know how you'd do that, because the way it usually works is, your code generates a proxy class that handles the COM stuff. Why can't you add a reference ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks, I have posted this question after searching in the google and I am still searching.
I have tried adding in the toolbox and then dropping it on the form. I have tried using Add a Referrence method it does not work.. I get an Catastrophic failure exception.
|
|
|
|
|
Hi
When i encrypt a text file using .Net rijndael encryption the size of the text file increases. I really don't want that the size of the file increasses because the whole application works over the size of the file. User will not be aware of the fact that whatever size he will enter would increase and thus could fail the application to work.
Or may be if some one knows that it increases the size by any certain size then i might sort this out by keeping some space for encrypted file in advance and giving user the detail of the size of the file after encryption.
Any suggestion to deal with this situation.
ta
|
|
|
|
|
Encrypting a file in a way that it can be decrypted is probably going to increase the size most of the time. What if you zip it, then encrypt the zipped data ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all,
Im starting a project, where i have to use 6 cameras (web cams, digital cams, ethernet cams) to control them via software, i have to take a picture and compare each of them to a standar one, and tell how similary are they in %.
Im wondering is there any software, libraries, applications, sourcode in c# or maybe in other plataforms, that you guys know, which i could use.. to learn how or to complement or modify it.
any suggestion??
modified on Saturday, April 12, 2008 2:26 AM
|
|
|
|
|
|
|
Hi,
Some of these articles[^] should interest you.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Is there any good articles out there on teaching me all the syntax for an app configuration file regarding assembly binding and probing and such? I have searched but it is tough for me being a C# newb(maybe I haven't been using the right terms).
Also, can I have the following
nunitdir/nunit.exe
nunitdir/nunit.exe.config
otherdir/testsuite.dll
nunitdir/nunit-framework.dll
QUESTION 1: Once Nunit goes to run my test suite, it can't fund the nunit framework.dll since nunit wasn't built referencing that dll. Can I just change the nunit.exe.config file to bind the framework dll in early?
QUESTION 2: If nunit.exe.config binds the framework.dll, and testsuite.dll.config binds a different framework.dll, who wins?
QUESTION 3: is there some kind of tutorial on the binding stuff somewhere?
thanks,
dean
|
|
|
|
|
Above, I meant to say "I have the following" NOT "Can I have the following" Sorry for the typo.
|
|
|
|
|
There's always the edit button
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
Hello. I want to write a vnc like program in C# and the biggest problem, I think, is capturing the screen and sending the screen image. I tried transforming the screen bitmap to a bytes array and compress it with GZipStream, but the result is ~44KB so I can't send this over the network.
I have 2 questions:
1. Do you know of a way to capture only the changes in the screen and not the entire desktop?
2. Do you know of an algorithm that scans an image and returns only the changes efficiently, size wise?
Any ideas will be appreciated.
Thank you in advance
|
|
|
|
|
Im not sure about finding which parts of the screen have changed, but what you can do to help with the filesize is to lower the image from 24-bit down to 16-bit, maybe change it into a PNG (i like PNG's)
That should help with filesize. Hang on while i check the size of a 1650*1080 bitmap compared to the same PNG.
EDIT: Hold up, there is no 16-bit. I really need to go to bed now
Anyway, 24-bit bitmap of my screen is over 5MB, into gzip that gave 168KB
A 24-bit PNG was about 220KB, gzip is er... 219KB
8-Bit BMP 1.68, gzip 64KB
8-Bit PNG 80KB, GZip 79KB
So, apparantly, the smalles size you can acheive is to Gzip an 8-Bit BMP.
I just thought. If you disect your screen into perhaps 16 sections, then compare the bytes of the old image with those of the new image for each of the sections, then you can see if something has changed. If you find one of the sections is different than it was previously, you can send that area of the screen along with whatever section it belongs to.
The only problem is, if your comparing the binary data of each section, if just one pixel where to change you'd end up sending the whole section, rather than just ignoring it. Well, anyway, sleep now.
My current favourite word is: Bacon!
-SK Genius
modified on Friday, April 11, 2008 9:58 PM
|
|
|
|
|
That's a good idea and to tell you the truth I tried scanning the entire image to find coordinates of the first pixel changed and the last one (from left to right and top to bottom). This gave me a 44KB on average to send (only changes). This of course with a 32 bit bitmap. Now I'm working on an algorithm to divide the bitmap into rectangulars of the same color (pixel value) and send only the coord of the top-left pixel, the rectabngular size and pixel value. Maybe you know a similar algorithm?
Thank you very much for your reply SK Genius.
|
|
|
|
|
I am using a browser object to view PDFs in my c# code:
{
wbBrowsePDF.Navigating += new WebBrowserNavigatingEventHandler(wbBrowsePDF_Navigating);
wbBrowsePDF.Visible = true;
wbBrowsePDF.Navigate(strFileName);
}
private void wbBrowsePDF_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
System.Windows.Forms.HtmlDocument document =
this.wbBrowsePDF.Document;
}
it works just fine and then I use:
{
wbBrowsePDF.Stop();
wbBrowsePDF.Navigate("about:blank");
wbBrowsePDF.Dispose();
}
to close the document.
Problem is that the acrobat reader (AcroRd32.exe stays open and must be killed using Task Manager.
Could anyone please suggest any solution?
Thanks.
|
|
|
|
|
What version of Acrobat Reader is installed? I vaguely remember a similar issue with version 7.something of it. (I said vaguely....) Unfortunately whatever details I have about it are at home.
If you have version 8.whatever, then I don't know what the cause is, and therefore can't help fix it.
I really hate to suggest getting the latest version from Adobe, because, well, it's Adobe.
Hope somebody else has an answer for you.
BDF
A learned fool is more a fool than an ignorant fool.
-- Moliere
|
|
|
|
|
Ok, it's not an answer to your question, but it's just so good I have to recommend it: get Foxit Reader[^] and forget about Ad...what was that name?
|
|
|
|
|
Excellent suggestion, Luis. All the functionality without all the bloat.
BDF
A learned fool is more a fool than an ignorant fool.
-- Moliere
|
|
|
|
|
hi guys
In my application i need to read a file and substitute a particular occurrence of a word/keyword by corresponding word... to do this i am using a excel sheet with 2 columns. first column will be the keywords to be searched in the source file and second will be the corresponding keyword to be replaced... can some one pls provide me with the code for doing the same. the prog me be able to read the source file do modification and store the file in the same location..
thanks
sid
|
|
|
|
|
After you build your list of replacements, use Regex.Replace to alter the file and then write back out. Come back when you have some code that is troubling you.
To get you started you will need FileStream , Regex , and a custom class or KeyValuePair to store your list of replacements. There is plenty on google[^] on these topics.
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
rsiddhartht wrote: In my application i need to read a file and substitute a particular occurrence of a word/keyword by corresponding word... to do this i am using a excel sheet with 2 columns. first column will be the keywords to be searched in the source file and second will be the corresponding keyword to be replaced... can some one pls provide me with the code for doing the same. the prog me be able to read the source file do modification and store the file in the same location..
This is one inefficient Son Of a codeBloat. Why are you storing the matches in Excel? If only somebody had invented a technology where data could be stored and retrieved quickly and efficiently. Hey - there's a money making idea for you.
Anyway - once you've retrieved your data and read in the file you could always use a regex.replace or a string.replace.
|
|
|
|
|
Still learning C# and am using a structure as illustrated below to hold data.
To get the data out I cast the data into the relevant type.
My question is this - is this an okay way to store ones data or would using a dataset or other structure be faster or more efficient?
ArrayList - contains N members
Arraylist - contains 4 members
3 strings
1 Arraylist - contains N members
Arraylist - contains 3 members
1 string
1 byte
1 datetime
You always pass failure on the way to success.
|
|
|
|
|
Interesting... I would do it slightly different. Use the struct keyword to create a structure. Then place structures inside of your ArrayList. It will be easier to reference.
Hogan
<br />
private ArrayList groupOfItems = new ArrayList();<br />
<br />
private struct GroupStruct<br />
{<br />
public string string1;<br />
public string string2;<br />
public string string3;<br />
public ArrayList subGroup;<br />
}<br />
<br />
private struct SubStruct<br />
{<br />
public string subString1;<br />
public byte oneByte;<br />
public DateTime subTime;<br />
}<br />
|
|
|
|
|
Thanks - looks good, structures are new to me so I will give them a go.
From what I understand structs are kept on the stack so access is faster as well.
You always pass failure on the way to success.
|
|
|
|
|
GuyThiebaut wrote: From what I understand structs are kept on the stack so access is faster as well.
a single struct would be, but if you're creating them inside an array list the memory they're stored in will be allocated by the arraylist which is on the heap.
You know, every time I tried to win a bar-bet about being able to count to 1000 using my fingers I always get punched out when I reach 4....
-- El Corazon
|
|
|
|