|
If this "fixed" it, I don't see why it did not work when you said you tried the "Split" function with just the vbLF...
Anyway... glad your code works OK for you now.
Happiness will never come to those who fail to appreciate what they already have. -Anon
|
|
|
|
|
right, not sure either at this point, but is working fine now. for whatever reason, it rectified the 'input past EOF' error....
|
|
|
|
|
I'm writing an application that currently uses RSA public-key encryption. However, for users using newer computers, I want to offer the ability to use ECDH (Elliptic Curve Diffie-Hellman) as this seems to have many advantages over RSA. I've been over the MSDN articles and have tried search Google and CodeProject to figure out what I'm trying to do, but no luck.
Basically the application should do the following when starting up:
1. Check if the system supports ECDH. If it does continue on, otherwise create RSA keys.
2. Check if ECDH keys have already been created using a specified name.
2a. If the ECDH keys exist with the specified name then load them into an object to use within the application
2b. If the ECDH keys do not exist with the specified name then create ECDH keys (which I believe should be a CngKey object)
I've figure out how to make sure the ECDH keys can be created and even create them. However I can't figure out how to do the following:
1. Load the keys into an ECDH object. I check for the keys and load them like this:
If CngKey.Exist(keyName) then
Dim key as CngKey = CngKey.Open(keyName)
End If
However once I have a CngKey object how to I apply that to an ECDH object (the key property of an ECDH object is read-only)?
2. I can't seem to delete a key once it is created. I tried the following:
Dim b As Boolean = CngKey.Exists(keyName)
Dim key As CngKey = CngKey.Open(keyName)
key.Delete()
b = CngKey.Exists(keyName)
If I run the above code, the second time I check if the key exist using b = CngKey.Exists(keyName) it always return true. Reading the MSDN documentation, it seems that when you call the CngKey.Delete method, it just prevents the CngKey object from being used. How can I actually delete the key permanently? What do I need to replace key.Delete() with so when b = CngKey.Exists(keyName) is called the second time it would actually return false? Or is there no way to actually permanently delete a named key?
Any other documentation, articles, links, etc. that shows how to use ECDH in VB.NET would be greatly appreciated. In the key I'm just trying to find how to load and save ECDH keys like RSA keys, so my program has multiple options.
Thanks in advanced for any help you can provided.
|
|
|
|
|
Someone actually tell me what's the best method for deploying between clickonce and windows installing deployments methods
|
|
|
|
|
This has nothing to do with Visual Basic, please choose a more appropriate forum.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
That depends on your requirements. There is no such thing as a "best method" in all deployment cases.
|
|
|
|
|
hallo..
im sorry if my english hard to understand, because my english is not well, but i trying with my best to write in english..!!
any body can help, how to draw backround picture in windows aero theme, like in firefox with theme..
thx..
|
|
|
|
|
I have picture box control.Using picture box.Height and picture box.Width in do loop i read the pixel information.When i use large resolution image(height and width of the image is more)it hang and not respond.how rectify this or set progress bar until the loop ends.
dim i,j as integer
dim img as image
img=picturebox1.image
do(i
|
|
|
|
|
leostalin91 wrote: When i use large resolution image(height and width of the image is more)it hang and not respond.how rectify this or set progress bar until the loop ends.
Would need to be executed on it's own thread, otherwise the UI-thread does not get the chance to repaint. The easiest way to do so, and add a progressbar, is using a BackgroundWorker [^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
i think, you can add Application.doevents in u looping..
|
|
|
|
|
i think, you can add Application.doevents in ur looping..
|
|
|
|
|
That's the most dangerous way to do it as DoEvents will allow you to click other buttons and possibly make the code reentrant.
The appropriate method is to farm the work off to a background thread.
|
|
|
|
|
I agree with Dave you need to process this on a background thread so the UI can update itself.
|
|
|
|
|
Hello. I am getting this stack overflow exception.
I have tried different things like:
- making the current class Shared
- or using a counter to see if the class already has an instance?
But none of them is working for me. Here is what I am trying ( read comments as well )
Imports SomeLibrary
---------------------------------
Public Class ABC
Private WithEvents instance As New ClassName
Public Sub New()
End Sub
End Class
So how can I get better of this exception? Thanks.
This world is going to explode due to international politics, SOON.
modified 16-Oct-12 4:04am.
|
|
|
|
|
You have a circular reference somewhere; does the class 'ClassName' from imported DLL have a reference to class 'ABC'?
|
|
|
|
|
So it appears that VS2012 does not use the same methodology to generate installations as VS2008. Fine, so be it, I will play along. After converting a project from VS2008 to VS2012, the solution explorer had my project and the install project I had created in VS 2008, the install marked as incompatible.
I downloaded the InstallShield Limited edition, installed it. All is fine.
I removed the old (incompatible) installation from my solution list (right click, remove from solution). When I did this my solution list appears to have disappeared and I only have my application left. According to the InstsallShield instructions I am to right click on my solution and add a new project, but I do not appear to have a solution any more, just my project.
Any idea how to get it back? The solution group, so I can have both the app and the install in there like I used to.
One thought was to create a new solution then add my project to it, but I do not see how to do that.
Thanks in advance
no-e
Updated: Never mind, found it, there is a setting on the options page to show the solution.
modified 15-Oct-12 13:08pm.
|
|
|
|
|
The Solution is there. If there's only one project in the solution it's hidden in Solution Explorer by default.
The fix this, go to Tools -> Options... -> Projects and Solutions on the left. In the right pane, check the box that says "Always show solution".
Done.
|
|
|
|
|
please i am having problems writing a program to merge sort using vb.net2010. here is my code any form of help will be appreciated.
i am also having problems outputing the sorted result into listbox2
Private Sub BTN_SORT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_SORT.Click
Dim arrayofinput()
Dim low As Integer
Dim high As Integer
Dim length As Integer
Dim middle As Integer
Dim temp As Integer
Dim m1 As Integer
Dim m2 As Integer
If low >= high Then Return
Dim length As Integer = high - low + 1
Dim middle As Integer = Math.Floor((low + high) / 2)
Do(arrayofinput, low, middle)
Do(arrayofinput.Length, middle + 1, high)
Dim temp(arrayofinput.Length - 1) As Integer
For i As Integer = 0 To length - 1
temp(i) = arrayofinput(low + i)
Next
Dim m1 As Integer = 0
Dim m2 As Integer = middle - low + 1
For i As Integer = 0 To length - 1
If m2 <= high - low Then
If m1 <= middle - low Then
If temp(m1) > temp(m2) Then
arrayofinput(i + low) = temp(m2)
m2 += 1
Else
arrayofinput(i + low) = temp(m1)
m1 += 1
End If
Else
arrayofinput(i + low) = temp(m2)
m2 += 1
End If
Else
arrayofinput(i + low) = temp(m1)
m1 += 1
End If
Next
ListBox2.Items.Add(ListBox1.Items.Add(input))
End Sub
|
|
|
|
|
benkazy1014 wrote: please i am having problems writing a program to merge sort using vb.net2010. here is my code any form of help will be appreciated.
i am also having problems outputing the sorted result into listbox2
We'll need more description of the problem; does it generate an exception? If yes, what did the message say?
Does it compile? Does it run? If yes, upto where? Did it error at all, or does it just generate a different output than expected?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
If it does not compile, you'll get a compiler-error. What does the error say?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Error 8 Variable temp, m1 and m2 hides a variable in an enclosing block.
do must end with a matchin loop.
temp is not an array,expression not a method
and a whole lot of errors . although it accepts inputs, it does not sort.have you ever tried anything on this topic? if yes how did you go about it. i am desperately in need of help. thank you.
|
|
|
|
|
benkazy1014 wrote: Error 8 Variable temp, m1 and m2 hides a variable in an enclosing block.
That means that you already have a variable called "m1" (and another m2) outside of that loop; that gets very confusing when reading code. It's best to give them descriptive names. Can you paste the offending block here? Perhaps we can rewrite it a bit
--edit; you already posted the code, that's what got this whole thing started. My mistake, I'm doing some things simultaneous. To the code, and first error;
Private Sub BTN_SORT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_SORT.Click
Dim arrayofinput()
Dim low As Integer
Dim high As Integer
Dim length As Integer
Dim middle As Integer
Dim temp As Integer
Dim m1 As Integer
Dim m2 As Integer
If low >= high Then Return
Dim length As Integer = high - low + 1
Dim middle As Integer = Math.Floor((low + high) / 2)
Do(arrayofinput, low, middle)
Do(arrayofinput.Length, middle + 1, high)
Dim temp(arrayofinput.Length - 1) As Integer
For i As Integer = 0 To length - 1
temp(i) = arrayofinput(low + i)
Next
Dim m1 As Integer = 0
Dim m2 As Integer = middle - low + 1
For i As Integer = 0 To length - 1
If m2 <= high - low Then
If m1 <= middle - low Then
If temp(m1) > temp(m2) Then
arrayofinput(i + low) = temp(m2)
m2 += 1
Else
arrayofinput(i + low) = temp(m1)
m1 += 1
End If
Else
arrayofinput(i + low) = temp(m2)
m2 += 1
End If
Else
arrayofinput(i + low) = temp(m1)
m1 += 1
End If
Next
ListBox2.Items.Add(ListBox1.Items.Add(input))
End Sub
That's one. The second problem is that your loop does not conform the standard. If you insert a "do" statement, rules require a "loop" statement (see docs[^]). As it is now, the compiler will not recognize where your loop ends (despite the indentation).
Once you got those two fixed, we'll move to the rest
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
can you please help me with code in vb.net
|
|
|
|
|
you'll have to modify this code to suit your needs, but this is how I sort/merge text files.
m& = LBOUND(Master)
s& = LBOUND(Slave)
t& = 0
DO
IF m& < MasterLines& THEN '* aka not eof(masterfile%)
IF s& < SlaveLines& THEN '* aka not eof(slavefile%)
IF Master(m&) > Slave(s&) THEN '* reached end of primary so flush secondary
printToFile Slave(s&), OChannel%, s&, t&
ELSE
printToFile Master(m&), OChannel%, m&, t&
END IF
ELSE
printToFile Master(m&), OChannel%, m&, t&
END IF
ELSE
IF s& < SlaveLines& THEN
printToFile Slave(s&), OChannel%, s&, t&
ELSE
EXIT DO
END IF
END IF
LOOP
CLOSE OChannel%
PRINT MasterLines& " lines merged from Master file "; Mast$
PRINT SlaveLines& " lines merged from Slave file "; Slav$
PRINT t& " Records written to "; OutPF$
DO
LOOP UNTIL INKEY$ > ""
SYSTEM
SUB printToFile (x$, channel%, RecsPrinted&, t&)
t& = t& +1 '* increment the appropriate array counter
RecsPrinted& = RecsPrinted& + 1 ' keep track of how many processed so far
PRINT #channel%, x$
END SUB
SUB MergeSort (array() AS STRING, start&, finish&)
IF start& < finish& THEN '* no need to do this for 0-sized sublists
length& = finish& - start& + 1
middle& = start& + (finish& - start&) \ 2
MergeSort array(), start&, middle&
MergeSort array(), middle& + 1, finish&
REDIM temp(0 TO length& - 1) AS STRING
FOR i& = 0 TO length& - 1
temp(i&) = array(start& + i&)
NEXT
mptr& = 0
sptr& = middle& - start& + 1
FOR i& = 0 TO length& - 1
IF sptr& > finish& - start& THEN
array(i& + start&) = temp(mptr&)
mptr& = mptr& + 1
ELSE
IF mptr& > middle& - start& THEN
array(i& + start&) = temp(sptr&)
sptr& = sptr& + 1
ELSE
IF temp(mptr&) > temp(sptr&) THEN
array(i& + start&) = temp(sptr&)
sptr& = sptr& + 1
ELSE
array(i& + start&) = temp(mptr&)
mptr& = mptr& + 1
END IF
END IF
END IF
NEXT
ERASE temp
END IF
END SUB
|
|
|
|
|