|
Not when a project is deleted, no. It's possible that some stuff gets in there when the code is run though, like settings files or minidumps.
|
|
|
|
|
Thanks Dave
Maybe they get there when VS2005 crashes, as it has done several times, but they just appear to contain a configuration file the contents o which is:
<configuration>
<configsections>
They are all itentical.
David Loring
!! Keep Music Live !!
|
|
|
|
|
HI , I want one function to be called repltedly after a perticular interval. SO i have implemented OnTimedEvent. In that I called my function IsFinish. Isfinish contains some more function calls.
If i call Isfinish from a button and get the values after some interval it is workig fine. but if I call this function from OnTimedEvent it is returning null. Please guide.
ciacia
|
|
|
|
|
There's no such event in the .NET Framework. Which Timer did you use? There are three in the .NET BCL:
System.Threading.Timer
System.Timers.Timer
System.Windows.Forms.Timer
|
|
|
|
|
i have implemented Imports System.Timers and on form load
AddHandler NotifyTimer.Elapsed, AddressOf OnTimedEvent
please tell me some other way
|
|
|
|
|
The System.Timers.Timer uses a seperate thread to call the timer elapsed handler code. If your code is trying to get data from user controls to do it's work, it won't get any data. This is because you can only use a controls methods and properties on the thread that the control was created on.
Let's see your OnTimedEvent method...
|
|
|
|
|
can you tell me the solution for my problem?
|
|
|
|
|
Please allow me to repeat myself:
Let's see your OnTimedEvent method code.
|
|
|
|
|
Private Sub OnTimedEvent(ByVal source As Object, ByVal e As ElapsedEventArgs)
IsFinished()
End Sub
Function IsFinished() As Boolean
Dim strLength As String
strLength = New String("255")
Dim strPosition As String
Dim IntLentgh As Integer
Dim IntPosition As Integer
strPosition = New String("255")
mciSendString("status track length", strLength, 255, 0)
mciSendString("status track position", strPosition, 255, 0)
IntLentgh = CInt(strLength)
IntPosition = CInt(strPosition)
If IntPosition >= IntLentgh Then
notifyTimer.Stop()
MsgBox(strPosition)
MsgBox(strLength)
End If
End Function
|
|
|
|
|
You're making a mistake with these strings ("255"). You're not creating an empty string 255 characters wide. YOu're making a string 3 characters wide, containging "255". Then in your mciSendString call, you're passing this string in parameters2, but in parameter 3, you're telling mciSendString that the string buffer you just passed in was 255 characters long. No, it's not, it's 3 characters long!
I think you're looking for this:
Dim strBuffer As New StringBuilder(255)
On top of that, you're completely ignoring the return value comming back from the call to mciSendString. You REALLY need to pay attention to that value:
Dim rc As Integer
rc = mciSendString("status track length", strBuffer, 255, Nothing)
If rc > 0 Then
' An error occured!
End If
|
|
|
|
|
OHHH, thaks a lot for your suggestion. I tried stringBuilder but it is not recognizing it I have also imported system.text.stringbuilder .
|
|
|
|
|
No, you Import System.Text, not System.Text.StringBuilder.
|
|
|
|
|
Hello,
I am creating an application using vb and SQL 2005.
I have a table of users, that contain there usernames and passwords. When a new user is added it stores all the passwords in clear text in the database.
What is the best method to use to be able to crypt the passwords in the database.
Also, when the user login, i have a sql statement that will compare the username and password that they enter in the login dialog box, to what is in the database. If the password is encryted, would I still be able to compare their password to see if they can still login.
i.e.
<br />
"Select * From Users Where LoginID=@LoginID And Password=@Password"<br />
Many thanks for any suggestions,
Steve
|
|
|
|
|
|
Hi Steve
You could use the SQL-Server HashBytes function with the SHA1 algorithm to store a hash of the concatenated user-id and password strings. Your code for authenticating a user would then be:
select * from Users
where LoginID = @LoginID
and HashedPassword = HashBytes('SHA1', @LoginID + @Password) The reason for not hashing just the password is that some-one with database access should not be able to see that two people have the same password - adding the user Id ensures that the hash value would be different.
Regards
Andy
|
|
|
|
|
MD5 is proven weak.
A better method would be to salt the password, encrypt it with your favorite (stronger) algorithm to get a hash of the salted password, then store the hash and the salt in the database.
When you go to check the users password, retrieve the password hash AND the salt, salt the entered password, run it through the same encryption algorithm you used to encrypt the original password to get it's hash, then compare to the two hashes.
There's examples of this all over the web. Just Google for "VB.NET password salt encrypt database". I highly recommend reading this[^] article on CP too.
|
|
|
|
|
Make sure you turn case sensitivity on for the columns you are encrypting. I had a nasty little bug once because of that.
Ben
|
|
|
|
|
Hi Everyone:
Cleako showed me a link where I can return records that were either added to or modified in a DataSet.
What I would like to do is show the user a message giving them the number of records that where added to the dataset and a number of existing records that where modified before they commit update to the database.
I didn't see anything like - MyDataSet.GetChanges(DataRowState.Modified.Count) or MyDataSet.GetChanges(DataRowState.Added.Count) which would make sense but isn't in the DataRowState class.
Anyone have an idea on how to accomplish this?
Thanks,
Quecumber256
|
|
|
|
|
The answer is staring you in the face. What does DataSet.GetChanges() return?? Another DataSet object! A DataSet is a collection of DataTables, which is a collection of DataRow objects. You can get the number of tables in this new DataSet quite easily:
Dim changes As DataSet = MyDataSet.GetChanges(DataRowState.Modified)
If changes IsNot Nothing AndAlso Not changes.HasErrors Then
' Get the number of tables in this changed dataset.
Dim numTablesChanged As Integer = changes.Tables.Count
' Enumerate through these tables and add up the number of rows in each.
Dim numTotalRecordChanges As Integer
For Each t As DataTable In changes.Tables
numTotalRecordChanges += t.Rows.Count
Next
End If
|
|
|
|
|
Dave:
If I read your example right you are sending the DataSet of only those records that where modified? So your example will show the total number of records in the dataset that where modified(changed)?
FYI - I'm so wet behind the ears in Visual Studio .NET there is a good chance I will drown .
Thank you,
Quecumber256
|
|
|
|
|
|
I have two functions. The first function search the directory for specific file extensions. I have a folder browser to browse to the folder in which I want to search for the files. The path is displayed into textbox1. Whatever file extension I type into textbox2, the filename with that extension will be added to listbox1.
Here is the code:
Private Sub GetDirectoryContents(ByVal dirs() As String, ByVal patterns() As String)<br />
'Declare variable.<br />
Dim dDir As DirectoryInfo<br />
<br />
For Each sDir As String In dirs<br />
If Not Directory.Exists(sDir) Then Continue For<br />
dDir = New DirectoryInfo(sDir)<br />
For Each ext As String In patterns<br />
For Each fi As FileInfo In dDir.GetFileSystemInfos("*." & ext)<br />
ListBox1.Items.Add(fi.Name)<br />
Next<br />
Next<br />
Next<br />
End Sub
The second function connects to an access database pulling data from tblExclude. The table has three fields(ExcludeID, ExcludeFilePath, ExcludeFileName). The code that I have will read the data in tblExclude and display the columns rows into listbox2.
Here is the code:
Private Sub SearchDatabase()<br />
<br />
Dim myConnString As String = "Provider=Microsoft.Jet.OleDB.4.0;Data Source=" & Application.StartupPath & "\File.mdb"<br />
Dim myConnection As New OleDbConnection(myConnString)<br />
myConnection.Open()<br />
Dim strSQL As String = "SELECT ExcludeFileName FROM tblExclude"<br />
Dim cmd As OleDbCommand = New OleDbCommand(strSQL, myConnection)<br />
Dim objread As OleDbDataReader<br />
objread = cmd.ExecuteReader<br />
<br />
While objread.Read<br />
Me.ListBox2.Items.Add(objread("ExcludeFileName") & "")<br />
End While<br />
objread.Close()<br />
myConnection.Close()<br />
<br />
Me.ListBox2.SelectedIndex = 0<br />
End Sub
I need these two functions to some how interact with each other to get it to do what I want it to do. I want to be able to check the db table to see if a specific file exist. If the ExcludeFilePath in tblExclude is equal to the file path in textbox1 then display ExcludeFileName from tblExclude into listbox2. If the ExcludeFilePath in tblExclude does not equal the path in textbox1 then perform the first function. I know that this may be a lot of information but I want to make sure it is comprehendible.
jds1207
|
|
|
|
|
All you have to do is check each file against your database using a little SQL:
SELECT Count(ExcludeFileName) FROM tblExclude WHERE ExcludeFileName LIKE ?Filename
Use the normal OldDbCommand object to execute this query, using it's ExecuteScalar method. Make sure you give the filename in an OleDbParameter object! If you get back anything over 0, that filename is in the database.
|
|
|
|
|
I would like to use an ampersand (&) within a string in a text for a label. I guess because it is used to underline characters in menus, the '&' does not appear in the label. Any ideas on how to display something like "A&M" for the text of a label?
Rich Feldman
|
|
|
|
|
I'm not sure if it works in VS 2003, but in VS 2005 you would just do this:
myLabel.Text = "A&&M"
|
|
|
|