|
nwr_mn wrote: i have a very little time left
Welcome to the real world, your holiday is over now, dont they teach you responsibility at university?
|
|
|
|
|
It sounds like SQLite is a nice database for standalone applications. Is this true for C#/NET apps? There are several NET wrappers out there for the DLL. Can someone give me some advice about what works and what does not? What NET wrapper should i get? Are there any pitfalls regarding set up and use that i should be aware of when developing C# apps?
|
|
|
|
|
|
|
You might want to ask an actual question.
About the only thing we can say to you is Google[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
using System;
using System.IO;
using System.Text;
namespace Steganography
{
public class BMPCoverFile : ICoverFile
{
private string fileName;
public BMPCoverFile(string fileName) {
this.fileName = fileName;
}
public IStegoFile CreateStegoFile(string stegoFileName, string message, string password) {
// Open the cover
FileStream inStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
// Check whether the cover is a bmp file
char b = (char) inStream.ReadByte();
char m = (char) inStream.ReadByte();
if (!(b=='B' && m=='M'))
throw new Exception("The file is not a bitmap!");
// Check whether the bitmap is 24bit
byte[] buffer = new byte[2];
inStream.Seek(28, 0);
inStream.Read(buffer,0,2);
Int16 nBit = BitConverter.ToInt16(buffer, 0);
if (nBit!=24)
throw new Exception("The file is not a 24bit bitmap!");
// Read the header from the cover
int offset = 54; // Header Size
byte[] header = new byte[offset];
inStream.Seek(0, 0);
inStream.Read(header, 0, offset);
// Write the header to the stego file
FileStream outStream = new FileStream(stegoFileName, FileMode.Create, FileAccess.Write);
outStream.Write(header, 0, offset);
// Create the unicode encoding
UnicodeEncoding unicode = new UnicodeEncoding();
// Add the length of the message inside the first 4 bytes
byte[] messageBytes = AddLengthAhead(unicode.GetBytes(message));
// Encrypt the message
messageBytes = CryptoHelper.Encrypt(messageBytes, password);
// Encode the cover using the LSB method
inStream.Seek(offset, 0);
LSBHelper.Encode(inStream, messageBytes, outStream);
inStream.Close();
outStream.Close();
// Return a new BMPStegoFile
return new BMPStegoFile(stegoFileName, password);
}
private byte[] AddLengthAhead(byte[] messageBytes) {
int len = messageBytes.Length;
byte[] bLen = BitConverter.GetBytes(len);
byte[] ret = new byte[len + bLen.Length];
for (int i=0; i < bLen.Length; i++)
ret[i] = bLen[i];
for (int i=0; i < messageBytes.Length; i++)
ret[i+bLen.Length] = messageBytes[i];
return ret;
}
}
}
}
what is done in this code ?? it has been commented as Adding message bytes to the start of the pixels of the Bitmap.
AMAN ANWAR
|
|
|
|
|
Once again, your best source for information is the person who wrote the code!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
> I guess it might have to caputre any Paint event in teh
> application and ignore it when this window is moving or resizing
But how do you know when the moving or resizing has finished?
I guess you should optimize your heavy painting code in the main form. You can start by enabling DoubleBuffer ControlStyles. Then optimize the paint code by only painting the invalidated portion.
|
|
|
|
|
hi,
i'm having error "Member not found." from the following code(in time of invoking member)..
<br />
foreach (MemberInfo mi in type.GetMember("test_mdi_Init"))<br />
{<br />
type.InvokeMember (mi.Name.ToString(), <br />
BindingFlags.Default | BindingFlags.InvokeMethod,<br />
null,<br />
ibaseObject,<br />
arguments);<br />
}<br />
what could be the problem? thanx for help
|
|
|
|
|
The flags of the member doesn't fit the flags that you have specified.
---
b { font-weight: normal; }
|
|
|
|
|
the member "test_mdi_Init" is a public method. also if use 'BindingFlags.Public' it throws an exception "Attemp to access a missing member". so what do you suggest?
|
|
|
|
|
BindingFlags.Default is 0, so you can remove that. I think you need BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance .
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
thank you for your reply. BindingFlags.InvokeMethod works fine. i didn't make my method 'ststic', that's why i was having exception. Sorry, my mistake
|
|
|
|
|
thank you for your reply. BindingFlags.InvokeMethod works fine. i didn't make my method 'static', that's why i was having exception. Sorry, my mistake
|
|
|
|
|
Hello evryone
i am able to make the text in a file be read out on the click of a button.But to pause and resume, im not able to. I tried using the Pause() method of SpVoice...but not fruitfull... How do i resume speaking too?
Kindly help
Cheers
Annie
-- modified at 8:05 Sunday 19th March, 2006
|
|
|
|
|
Could you please rewrite your post (in English if possible) so that someone will be able to help you...
Provide more information etc...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I have to read out the contents in a file on a buton click. I cam make it speak.But not able to pause and resume. I tried using the Pause() method of SpVoice...but not fruitfull...
I have to code this in C#. Already done code is in VB.
I already posted in english only.
Kindly help.
Cheers
Annie
|
|
|
|
|
Hello everyone..I am able to do so...The pause() and resume() fns work jus fine..
|
|
|
|
|
I created a DataView, the associated DataTable has some calculated columns which is from other DataTable (Table B). Whenever I changed something in Table B, the DataView won't reflect the latest changes in the calculated column.
How do I refresh the DataView, so that it reevaluate the calculated columns? I tried to purposely change the RowFilter but to no avail.
Thanks.
|
|
|
|
|
I have assigned a string[] object to a property grid and I am able to view and edit the elements. I have turned off the default editor (i.e. the ellipsis is no longer shown), by implementing an extension of the UITypeEditor class and overriding the GetEditStyle method and setting UITypeEditorEditStyle to None. I have called this class NoEditor.
However next to the string[] object in the property grid there appears "String[] Array". I do not want to show this. So I wrote this class:
internal class HeadingListConverter : ExpandableObjectConverter
{
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is string[])
{
return "";
}
return base.ConvertTo(context, culture, value, destType);
}
}
These two lines are added to the property,
[EditorAttribute(typeof(NoEditor),typeof(UITypeEditor)),
TypeConverter(typeof(HeadingListConverter))]
However, although now the object displays the text I require next to it, the result is that the string[] object is displayed as a System.String[]. So it displays the properties of the System.String[] object like rank and length rather than the elements which I require.
What am I doing wrong? I hope I have explained the problem clearly - any help is appreciated.
|
|
|
|
|
Got it now!!! FYI, extend from ArrayConverter instead of ExpandableObjectConverter.
|
|
|
|
|
Is it possible to get floating panes for windows applications in C# .... just like the 'properties' and 'solution explorer' panes in the Visual Studio .NET IDE
-- modified at 3:48 Sunday 19th March, 2006
|
|
|
|
|
For VS2005, you need to install VSIP sdk, its an extensible sdk. Using VSIP you can create floating pane like properties, solution explorer etc. Also you can implement functionality similar to floating pane.
Regards,
Shiby
|
|
|
|
|
I want to create a button on the Visual Studio standard toolbar (an addin basically) which will give me the path of the currently opened project (solution file) in the IDE. I created a an addin with the following code - 'Application.StartupPath'. However all that this button does is give me the path of the IDE (i.e. devenv.exe). I want the path of the currently opened project. Any suggestions guys.
|
|
|
|
|
If what you are trying to retive is the path of your application when it is running,
//you can use the following function that will return the oath string
Directory.GetCurrentDirectory()
Adn Dont forget to include
using System.IO;
|
|
|
|