|
dhananjaysonar wrote: but i want that code to be implemented for project so that i can send data in image for security purpose
Please note that security through obscurity[^] (including steganography) is generally a bad idea unless you're absolutely forced into using it.
That said, there is a wonderful series of articles here on CP that walks you through steganographic techniques. They can be found here[^].
|
|
|
|
|
Vega02 wrote: Please note that security through obscurity[^] (including steganography) is generally a bad idea unless you're absolutely forced into using it.
Only if it is used on its own. As part of a suite of security measures it can be beneficial.
|
|
|
|
|
dhananjaysonar wrote: can any body implement the code given in the article
There are probably some people that are able to implement this. The real question is: what are you willing to pay them for doing it or do you think someone will spent his freetime for doing your work.?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi all,
I want to call a function with string[] using invoke method, but compiler gives an error message "Parameter count mismatch." When I try to invoke a function with int[], there is no problem. Any suggestion? Here is the code;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public delegate void TbWrite(string[] eMessage);
public TbWrite writeTb=null;
public Form1()
{
writeTb = new TbWrite(TbCallBack);
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string[] veri = new string[] { "data1", "data2" };
this.BeginInvoke(writeTb, veri);
}
public void TbCallBack(string[] mData)
{
textBox1.Text = mData[0];
textBox2.Text = mData[1];
}
}
}
Regards.
Cengiz EKEN
|
|
|
|
|
Check out the signature for Control.BeginInvoke Method (Delegate, Object[])[^]. Notice the second parameter. It's modified with the params keyword, which means that you can pass zero to many parameters in addition to the delegate.
(actually, if you don't pass any additional arguments to BeginInvoke , I'm assuming that Control.BeginInvoke Method (Delegate)[^] is called instead.)
So when you want to pass an array of strings to BeginInvoke , do this:
this.BeginInvoke(writeTb, new object { veri });
This makes the entire string array a single argument that can be passed to your callback method.
Now, why does the integer array work when the string array does not? I think it has to do with the string array being an array of reference types. The BeginInvoke method is seperating out, for lack of a better word, each element of the array and treating them as seperate objects instead of treating the array as a single object.
So the compiler is interpretting the call to BeginInvoke as:
this.BeginInvoke(writeTb, "data1", "data2");
Two parameters are getting passed to your callback instead of one, which is where the mismatch exception is being thrown.
I'm guessing that the reason that the integer array doesn't have the problem is that the compiler is treating it as one object.
|
|
|
|
|
Thank you for your explanatory answer, it wat too useful to understand the error, but there still some point. Here is the new question regarding this
When I changed the code as follows, it gives again the same error
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public delegate void TbWrite(object [] eMessage);
public TbWrite writeTb = null;
public Form1()
{
writeTb = new TbWrite(TbCallBack);
InitializeComponent();
}
public void TbCallBack(object [] mData)
{
textBox1.Text = mData.GetValue(0).ToString();
textBox2.Text = mData.GetValue(1).ToString();
}
private void button1_Click(object sender, EventArgs e)
{
object[] veri = new object[] { "data1", "data2" };
this.BeginInvoke(writeTb, veri );
}
}
}
|
|
|
|
|
ceken wrote: object[] veri = new object[] { "data1", "data2" };
This gives you a problem for the same reasons I described in my previous post. You need to wrap your array inside an object array so that it's treated as one object:
string[] veri = { "data1", "data2" };
this.BeginInvoke(writeTb, new object { ver });
The string array is placed in an object array. The object array being passed to BeginInvoke only has one element, so it matches the parameter count of your callback when it passes that element to it.
|
|
|
|
|
Hi all,
I'm looking for a way to call VS2005 Shared Addin functions from an external VS2005 application.
a) The functions defined in Addin need some special demands?
b) In application how to invoke the function?
Thanks
|
|
|
|
|
|
Hey,
Could someone please point me into the right direction as to what I'd need to use in order to retrieve the size of a file on the web, without downloading the whole thing.
Thanks
|
|
|
|
|
You won't know unless you try to download the thing. There's nothing in the HTTP spec that allows for this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Try inspecting the ContentLength when you using WebRequest and see if it helps.
|
|
|
|
|
Well I solved my own problem with some help from google.
If anyone was wondering on how you do this - I achieved it with the following code:
WebClient client = new WebClient();
client.OpenRead("http://www.website-here.com/");
string fileSize = client.ResponseHeaders.Get("Content-Length");
That's about it.
|
|
|
|
|
Hi all,
I'm new to C# and currently writing an application for a Windows Mobile 5.0 device using the WebBrowser Control. Now, I'd like my application to process some hyperlinks, instead of the WebBrowser sending a request to the webserver.
There is a possibility to call back a method from within an HTML document (by defining an onclick event in a hyperlink: onclick="window.external.TestMethod('teststring')"). But this does not seem to be supported by WM 5.0 (I can't find the ObjectForScriptingProperty I would have to set, for instance), or am I mistaken?
Is there any alternative way to intercept a click on a hyperlink, some kind of work around? I'm grateful for any kind of help.
Thanks in advance.
Mary
|
|
|
|
|
|
That is excactly what I was looking for. Thanks a lot!
|
|
|
|
|
Does anybody know, how the System.Reflection.Emit.EventBuilder works? How can I define a simple event with it?
|
|
|
|
|
|
I haven't any problem with Emit technology, excepting EventBuilder class.
It's simple to create an "event" as ilasm does (using delegate field, public methods add_* and remove_*)... but it isn't an event(Type.GetEvent(...) returns null)!
EventBuilder perfoms three interesting methods - SetAddOnMethod, SetRemoveOnMethod and SetRaiseMethod.
And... what's the methods body should be? ILasm way? If yes, how can I get a delegate field for EventBuilder based event?
|
|
|
|
|
Hi all,
Are there any controls in C# that can be used as a standard old StringGrid? The DataGrid looks nice and all but it seems to require a DataSource and I'm not using one.
Basically, I just need a way of visually representing a two dimensional string array. OK, maybe not just representing, I need for the user to be able to edit fields in this grid during run time.
Any suggestions?
|
|
|
|
|
why not create a 2 column array and allow the user to edit it and then apply it as a data source to the grid?
Pakistani Memon
Prime Minister
Post Meridian
|
|
|
|
|
Sounds good, but how do I apply a 2D array as a data source to a datagrid?
|
|
|
|
|
you have two choice
either you create a 2-column data table
or
create a class with two properties and use the collection as an object data source to the data grid
Pakistani Memon
Prime Minister
Post Meridian
|
|
|
|
|
Sir/madam,
I wanted to know the basic difference between internal and internal protected .As i know both are accessible with in the drive class. and both are accessible under the object of their class.Both are accessible with in the assembly.
So my question is what is the basic bifference between them.
Thanks and regards
pankaj garg
|
|
|
|
|
amaneet wrote: I wanted to know the basic difference between internal and internal protected
internal means accessible only to other classes within the assembly.
internal protected means accessible only to derived classes within the assembly. No other classes (even within the assembly) can access something marked as internal protected .
|
|
|
|