|
Would anyone happen to know how to use the start.dll to open files? what parameters it takes and what the basic code is needed to get it working? basically i want to be able to pass any file to the start.dll and it will then open the file in the right application, just like normally happens when you open a file in windows explorer.
|
|
|
|
|
You don't need a DLL to do that...
Simply use:
System.Diagnostics.Process.Start("filename");
that will open the specified file in the asociated program.
--------------------------------------------------------
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi all,
I would like to store a string in a file using Rijdael encrypt method , and I'm looking for a way to store the iv (Initialization Vector) inside the encrypted file as well, in this way the user doesn't have to remember both the key and the iv.
My solution is to save the iv as plain text at the beginning of the file followed by the encrypted text.
//declaration used by both write and read
BinaryFormatter bformat = new BinaryFormatter();
Rijndael rij = Rijndael.Create();rij.Key = key;rij.IV = iv;
//write to file
Stream stream = File.Open(label3.Text, FileMode.Create);
CryptoStream crypt = new CryptoStream(stream, rij.CreateEncryptor(), CryptoStreamMode.Write);
bformat.Serialize(stream, iv);
bformat.Serialize(crypt, "hello");
stream.Close();
crypt.Close();
//read from file
Stream stream = File.Open(label3.Text, FileMode.Open);
CryptoStream crypt = new CryptoStream(stream, rij.CreateDecryptor(), CryptoStreamMode.Read);
//set the iv
rij.IV = (byte[])bformat.Deserialize(stream);
//read the encypted data
string test = (string)bformat.Deserialize(crypt);
stream.Close();
crypt.Close();
My problem is : (string)bformat.Deserialize(crypt); throw an exception : "Binary stream '190' does not contain a valid BinaryHeader".
What's the matter?
The problem is crypt.position is different from stream.position ?
Do you know any other way to save the iv in an encrypted file?
Thank Francy
|
|
|
|
|
I guess that something is written to the stream when you create the CryptoStream. Try to read and write the IV before you create the CryptoStream.
---
b { font-weight: normal; }
|
|
|
|
|
HI
HOw to change the language of the messagebox button
Mohamad A. Flefel
C#.net Developer
|
|
|
|
|
Do extensive research on localization. Plan for about a 2-3 week project to implement it into a working project.
|
|
|
|
|
Sorry : but i doesn't Understand
Mohamad A. Flefel
C#.net Developer
|
|
|
|
|
Search at Code Project for HeyboBox. This is customize Message Box dll source code is not give damo project is there. You can ask the writer to share the code with you if he aggrees, this will help you out some way.
|
|
|
|
|
Hello ,
How can i save an image in sql table ?
Mohamad A. Flefel
C#.net Developer
|
|
|
|
|
|
This is the function to upload the file
public string imageupload()
{
string FileName=null;
if (filUpload.PostedFile.FileName=="")
return " ";
filUpload.PostedFile.FileName.Substring (filUpload.PostedFile.FileName.LastIndexOf(".")+1);
FileName = DateTime.Now.ToString().Replace("/","").ToString().Replace(" ","")+ "." + filUpload.PostedFile.FileName.Substring (filUpload.PostedFile.FileName.LastIndexOf(".")+1);
FileName = FileName.Replace(":","");
if(filUpload.PostedFile.ContentLength>0)
filUpload.PostedFile.SaveAs(Server.MapPath("itemimages") + "\\" +FileName );
return FileName;
}
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hi, i have to interface my c# software,
with an old activeX in vb6 language,
i never do this thing and i don't have any idea.
someone can give me a simple example to do this.
i would like to understand how can i pass parameters,
if the activeX want variant variables how can i pass
these?
thanks.
Clif
|
|
|
|
|
I have to pass a dynamic array of structures from an unmanaged DLL to C#. I wrote the following wrapper-function.
Unmanaged C++ DLL:
typedef struct browserStruct<br />
{<br />
unsigned long id;<br />
unsigned char name[250];<br />
} structTypBrowser;<br />
<br />
extern "C" __declspec(dllexport) unsigned long __stdcall sv_getDocClassList(<br />
unsigned long &cnc,<br />
unsigned short numOfElems,<br />
structTypBrowser *browserArray<br />
) {...}
In C#:
public struct svStructTypBrowser<br />
{<br />
private UInt32 m_id;<br />
private string m_name;<br />
}<br />
<br />
[DllImport("SVConDll.dll")]<br />
private static extern UInt32 sv_getDocClassList(<br />
out UInt32 c,<br />
out ushort numOfElems,<br />
out IntPtr browserArray
);<br />
<br />
public getDocClassList() {<br />
IntPtr p1;<br />
svStructTypBrowser[] m_docClasses;<br />
...<br />
try<br />
{<br />
result = sv_getDocClassList(out m_cnc, out noe, out p1);<br />
<br />
m_docClasses = (svStructTypBrowser[])Marshal.PtrToStructure(p1, typeof(svStructTypBrowser));<br />
}<br />
}
The IntPtr p1 is null after calling sv_getDocClassList().
Has anybody a solution?
|
|
|
|
|
hi all
i m working on a data mining project and need the source code of fuzzy c-mean clustering algorithm
can anyone help me in finding.
regards
|
|
|
|
|
If you google for Fuzzy C-mean Cluster, you will find many algorithms. Since they are written as pure mathematical equations, then it should be simple for you to come up with your own source code. But you will find such implementations to be highly guarded, so do not expect anyone to just hand you source code for such a complex implementation.
...and you do not have to ask the question multiple times. Only once is needed.
|
|
|
|
|
hi all
i m working on a data mining project and need the source code of fuzzy c-mean clustering algorithm
can anyone help me in finding.
regards
|
|
|
|
|
Hi
you can use matlab.there is tools in matlab for fuzzy c-mean clustering.
|
|
|
|
|
Hello!
I have 2 Questions.
(1) I have made a DeskBand in C# in which I can switch b/w taskbar and System Tray. Means if I Right click on taskbar toolbar and press “Move to System Tray” Context menu item it hides it self on Taskbar and Notification icon becomes visible. And if I click on notification icon and press “Move to TaskBar” Context menu item, then it hides it self on system tray and displays on task bar but also show the Windows own TaskBar Context Menu (See Attached Screen Shot). How Can I stop that event from being fired.
(2) Can I hide/show the Quick Launch Bar (On Taskbar) using C# my own Button
For any further help on this topic i cand send u attached snapshots with it on ur mail because i think theres no attached like stuff in it.
|
|
|
|
|
How are you hiding to toolbar? I want to hide my toolbar (deskband) during uninstall. It unregisters fine but a copy off the dll is held in memory by the shell.
|
|
|
|
|
Hi All
I have a window form that shows some lines Arabic text on a label.What I want to do is when mouse goes to some word the meaning of that word should me displayed in the Tool Tip? Any idea how to do this in C#?
Thanks in advance
With best regards
Qumer Mumtaz
|
|
|
|
|
u can use the event mousemove
add the code that set tool tip in the Mousemove event for the label
private void label1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.toolTip1.SetToolTip(label1,"");
this.toolTip1.SetToolTip(label1,"Meaning");
}
Mohamad A. Flefel
C#.net Developer
|
|
|
|
|
Hi
Thank you for reply but I think you mis understand what I want to do. Let say the text of the label is "That is a Book". So when the mouse is over "That" it should display the meaning of "THAT " only and when mouse is over "BOOK" its should display the meaning of "BOOK"
|
|
|
|
|
Hi all,
I want to find if a given point specified with x & y coordinates of double type, lies within a polygon or not.
This algorithm should also work for points on edges of polygon.
If given point is on the edge of the polygon, or same as the vertex of the polygon then algoryhtn should say that point is inside the polygon.
If anyone has any idea about how to do it, please help me.
I have tried several algorythms but those are not working for points on edges of polygon.
Thanks in advance.
Sulakshana B.
|
|
|
|
|
You can try the following method,
just pass the point object to it,
The points is an array of points of the Polygon edges.
public bool CheckPoint(Point po)
{
GraphicsPath grap = new GraphicsPath();
grap.AddLines(points);
grap.Widen(new Pen(Color.Red,1));
if(grap.IsVisible(po))
return true;
else
return false;
}
Hope that works fine for u,
Regards,
Pramod
|
|
|
|
|
Hi pramod,
Thanx for your reply.
I have already tried this method using Point & PointF classes.
But my point has x & y coordinates of double type.
So this solution is not useful for me.
Anyway thanks for your kind reply.
Sulakshana
|
|
|
|