|
Can you possibly give me an example of what you are saying?
Illegal Operation
|
|
|
|
|
use MouseDoubleClick instead...
Point p = dataGridView1.PointToClient(new Point(e.X, e.Y));
DataGridView.HitTestInfo tmp_hinfo = dataGridView1.HitTest(p.X, p.Y);
if (tmp_hinfo.RowIndex == -1 || tmp_hinfo.ColumnIndex == -1)
return;
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
what you can do is provide an overload constructor for the second form that takes a datarow as a parameter
<br />
public Form2(DataRow drow):this()<br />
{<br />
this.text1.text=drow["Name"].ToString();<br />
}<br />
and as to figuring out which data that has been selected just handle "CellDoubleClick" and/or "RowHeaderMouseDoubleClick" events and then send the datarow selected by using the selected row from the event handler argument. like in this code:
<br />
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)<br />
{<br />
new Form2(dataGridView1.Rows[e.RowIndex].DataBoundItem).Show();<br />
}<br />
hope this does the trick for you
|
|
|
|
|
I need to convert a coded string back to its original ascii charcters in c#.
The string has been coded by a vb6 application that I dont have the encoding code for but I do have the decodeing code as detailed below.
Public Function QLDecryptPassword(ByVal strPassword As String) As String
Dim intCharCounter As Integer
Dim intCharASCII As Byte
Dim strDecryptedPassword As String
If (strPassword = vbNullString) Then Exit Function
intCharCounter = 1
For intCharCounter = 1 To Len(strPassword)
intCharASCII = Asc(Mid(strPassword, intCharCounter, 1))
intCharASCII = 255 - intCharASCII
strDecryptedPassword = strDecryptedPassword & Chr(intCharASCII)
Next
QLDecryptPassword = strDecryptedPassword
End Function
can someone please let me have the equivelent c# code.
I have had a go using byte, byte[], char[], int convert.toint16,32.........etc but I just cant seem to get there.
any help greatly appreciated.
Bryden
|
|
|
|
|
The code makes very little sense to me, but you can get the ASCII encoding of a string easily: Encoding.ASCII.GetBytes("some string") gives a byte[] containing the ASCII values.
|
|
|
|
|
Hi,
the highest threshold you have to overcome is the fact that all .NET languages have strings consisting of Unicode characters which take 16-bit each.
Now your original decryption code is taking a series of (unsigned) bytes and complementing all the bits (that is what x=255-x basically does); BTW encryption would have to be identical to one undoes the other.
The first decision to make is whether you want to deal with your password as a string or as a byte array. The natural thing to do is a byte[], since it isn't really a string in the .NET sense nor in any other sense, it just accepts all possible bit patterns without giving them any particular meaning, i.e. it is just binary data, hence best represented by a byte[].
So it could be as simple as:
public void crypt(byte[] data) {
for(int i=0; i<data.length;>}
which modifies the array content in place, useful for both "encrypt" and "decrypt" (quotes due to the fact that it doesn't offer much protection against prying eyes).
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
|
|
|
|
|
Hi,
I see Luc has beaten me to it.
Chances are that the old programme represents the string as single bytes so you should read the encrypted password into a byte array and decrypting will then just be some simple arithmetic.
To turn the the byte array into a unicode string you will need to select the correct encoding. The obvious one to try is Encoding.ASCII but this won't work if your data has character codes above 127. Windows 1252 is a single byte encoding, "provided for compatability with legacy systems" and is most likely correct.
Alan.
Example code:
public string QLDecryptPassword(byte[] encryptedPwd) {
byte[] decodedBytes = new byte[encryptedPwd.Length];
for (int i = 0; i < encryptedPwd.Length; i++){
decodedBytes[i] = (byte)(255-encryptedPwd[i]);
}
Encoding coding = Encoding.GetEncoding(1252);
return coding.GetString(decodedBytes);
}
|
|
|
|
|
thank you for the prompt answers and code examples.
I now have a working decrypt function so i can start pulling my hair out (what little i have) on the next bit of the program..........
|
|
|
|
|
I have returned with my "small" problem.
Short overview:
1) Problem was/is that my graphics disappeared when you move them out of screen borders and pull them back or put some other window over them.
2) Graphics are updated every time I move my trackbar (which gives values to function to draw the graphic based on the values)
So I've made some progress, but still stuck on other part.
I have 3 different functions, one for graphic, second for graphic and third for axis.
I solved the paint problem with Axis, since its static and never changes, so it was quite easy to convert to paint event. On the other hand, graphs have both 2 parameters that they receive and the graph changes after that according to the values given.
Example : public void JoonistaGraafik(int k1, int k2)
now when I want to make it to paint event "public void JoonistaGraafik(object sender,PaintEventArgs e, int k1, int k2)"
I have problem calling out in InitializeComponents();
this.GraphPanel.Paint += new System.Windows.Forms.PaintEventHandler(JoonistaGraafik(slider_a, slider_b));
the thing is that, my two values "slider_a" and "slider_b" are generated in the trackbar_scroll event and then JoonistaGraafik(slider_a, slider_b); was called out.
I'm pretty bad in explaining, but I hope that made a bit sence.
In conclusion, the question is, how can I call out
"this.GraphPanel.Paint += new System.Windows.Forms.PaintEventHandler(JoonistaGraafik(slider_a, slider_b));"
if the slider_a and slider_b values have to change when I move the trackbar.
Or how can I make a paint event which gets values from trackbars (means the graphic has to update itself every time trackbar is moved).
Thanks for reading, and I hope someone can help me out (again).
|
|
|
|
|
StuffyEst wrote: Subject: Graph Disappear Problem vol 2
I didn't knew, now questions come in volumes.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
well I have old post but thats like on page 30.. and I have serious doubts people care to watch pages that far.
|
|
|
|
|
Hi,
I gave you all the necessary information 5 days ago[^], and I can tell you there is no way around doing it all in the Paint handler. You simply must, it is the only way to get it to paint whenever something needs repainted (as with uncovering part of your window when it has been covered by something else; as with resizing, minimizing and maximizing a window; as with printing which can reuse all the painting code; etc).
In your specific situation, if you have two parameters that may change and cause your drawing to become invalid, what you do is:
1. store the drawing parameters that define your drawing as class members
2. draw everything (say on myPanel) in its Paint handler based on those parameters
3. and change those parameters where ever you feel you need to; and when you do change them, call myPanel.Invalidate() which will eventually result in myPanel.Paint() to be called automatically.
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
|
|
|
|
|
Thanks a lot, finally got it all working as I wanted
|
|
|
|
|
In Windows Vista, the privilege of the application can limit many parts such as registry access etc.
Is there a way to set the provilege level to "Run this program as an administrator" when you click build in Visual Studio?
Thanks.
|
|
|
|
|
|
Greetings all! I am trying to run an UPDATE command on an XLS file that I have opened a connection to. However, the RunNonQuery() method throws the exception:
“No value given for one or more required parameters.”
ErrorCode -2147217904
Here is the code:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""C:\test.xls"";Extended Properties=""Excel 8.0;HDR=NO;""";
OleDbConnection con = new OleDbConnection(connectioinString);
con.Open();
OleDbCommand com = con.CreateCommand();
com.CommandText = "UPDATE [Sheet1$A1:A1] SET F1 = 'True'";
com.ExecuteNonQuery();
con.Close();
I’m pulling my hair out trying to figure out what I’m doing wrong… I was following the example from http://support.microsoft.com/kb/316934#12 to the letter, but I can’t figure out what I’m missing.
Can anyone point me in the right direction (or just let me know)?
Thank you all in advance!
|
|
|
|
|
Anticast wrote: com.CommandText = "UPDATE [Sheet1$A1:A1] SET F1 = 'True'";
why are you doing a range from A1 to A1?
try this
UPDATE [Sheet1$] SET A1 = 'True'
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Oh my... After running some trial and error testing by isolating each step I realized that my connection string had "HRD=NO" instead of the correct "HDR=NO"... so the connection was taking the first row as the header and that was causing the conflict.
For everyone else that may want to use this technique, it does work. If you want to read/write to cell B2 on worksheet MySheet you can use:
"SELECT * FROM [MySheet$B2:B2]"
"UPDATE [MySheet$B2:B2] SET F1 = 'Value'"
But you need to specify HDR=NO in the connection string.
See http://support.microsoft.com/kb/316934#12[^] for a step by step walkthrough.
Hope this helps someone.
|
|
|
|
|
Hi, Please help
I am new to programming. and I am trying to update a value in the database(ACCESS) with a value in a textbox on an ASP page.
the conditions are that "value" in database can only change if it is smaller than value in textbox in the ASP page.
I can INSERT, UPDATE, and DELETE values in the database from the ASP page. I just dont know how to write it with the "if" statement so that it can work
thanks for the help
|
|
|
|
|
daks906 wrote: I just dont know how to write it with the "if" statement
if( bMyCondition)
{
}
|
|
|
|
|
Below is the code i use to update the database. I just wanted to know how to write the code to UPDATE database value only if it is smaller than the value of the textbox on the ASP page
public void upOk_click(object sender, EventArgs e)
{
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "UPDATE [Product]" +
"SET [CurrentBid]" + "='" + priceUpdate.Text + "'"
+
"WHERE [ProductID]=" + idDDL1.SelectedItem.Text;
cmd.ExecuteNonQuery();
DisplayTable();
}
|
|
|
|
|
why are you double posting? Didn't you ask the same question on the asp.net forum?
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Can anybody help me with the simplest code for playing a sine wave of 200hz using directsound. Runnable in Visual Studio 2008 with directsound as reference.
|
|
|
|
|
Hi,
of course. Here is the skeleton:
public class MySineWavePlayerUsingDirectSound {
public MySineWavePlayerUsingDirectSound() {
}
public void Play(...) {
}
}
So all that is left to do, is reading up on DirectSound and stuffing some code in the skeleton.
BTW don't forget to add the right references.
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
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|