|
Why are you choosing a difficult way when you can easily do this with the functionality provided by the .NET Framework otherwise you have to adopt a difficult way by using APIs to get the current key pressed store it into a StringBuidler object assign a * to the inputbox for key pressed and repeat the process to get the work done and I think you should have looked at Rule No. 9 before even creating this thread.
AliAmjad(MCP)
|
|
|
|
|
arranmc182 wrote: Password = "test"
It is considered a bad idea to have plaintext passwords embedded right in your code. I hope you plan on using some crypto algorithm.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
You can simply use the MaskedTextBox from the toolbox. Then set its password char to "*" .
Thanks,
Dan
|
|
|
|
|
Hi all,
I am tring to use this property bag.
http://www.codeproject.com/cs/miscctrl/bending_property.asp
Does any one has the VB.net Version
Thanks
Dana
|
|
|
|
|
Hi all,
I am working in vb.net and i am using sql server as back end which is stored on the server.
Client can access the database using his user id and password,
but the problem is that with the same login account the user can login from more than one client machine.
:-OI want that if the client has logined using suppose user id A and password A
then he will be not able to login again using the same user id and password from another client machine.
So how can it possible? will i have to maintain session like Asp.net ?
if yes then how can i maintain session using vb.net
Any idea would be appriciated heartly
Thanks with anticipation
|
|
|
|
|
Add a field to your user account table that indicates whether the user is currently logged on.
If a user is logging in and the value in this field is false, set it to true.
If a user is logging in and the value in this field is true, disallow the login.
When the user logs out, set the value in this field back to false.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hello,
my name is sai kishore.Im working on a application which will ask the user for the backup,if he wish to take a backup,it must allow.im doing this application in vb.net 2005.
im unable to get the code for this.please help me,
my code is as follows
Private Sub cmdYes_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdYes.Click
'Dim ProcessId As Integer
Dim ProcessId As Object
Dim hProcess As Integer
Dim ExitCode As Integer
Dim LogFileName As String
Dim Process_handle As Integer
Dim path As String
'Dim vntretval As Variant
On Error GoTo localerror
'Check for User Name
'To check Export File Name.
If txtflname.Text = "" Then
MsgBox("Enter Export File Name.", MsgBoxStyle.Information)
Exit Sub
End If
'UPGRADE_WARNING: Screen property Screen.MousePointer has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6BA9B8D2-2A32-4B6E-8D36-44949974A5B4"'
'System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
System.Windows.Forms.Cursor.Current = Cursors.Default
path = dirExp.Path
'checks if any file name is entered
'calls the procedure Conn_user;it returns true if connection
'is established
Dim strPwd As String = ""
Dim Usname As String = ""
Dim Uspass As String = ""
Dim strcopy As String = ""
SystemParameters()
If OptData.Checked = True Then
Usname = strsuperuser
Uspass = strSupreUserPassword
ElseIf OptPhoto.Checked = True Then
Usname = strPhotouser
Uspass = strPhotoUserPwd
End If
'ProcessId = Shell(resbckdls.Fields("BACKUP_NAME").Value & " " & Usname & "/" & Uspass & "@" & strUserConnect & " File = '" & lblPath.Text & "' log='" & Mid(lblPath.Text, 1, InStr(1, lblPath.Text, ".") - 1) & ".log'", AppWinStyle.Hide)
ProcessId = Shell("Exp" & " " & Usname & "/" & Uspass & "@" & strUserConnect & " File = '" & lblPath.Text & "' log='" & Mid(lblPath.Text, 1, InStr(1, lblPath.Text, ".") - 1) & ".log'", AppWinStyle.Hide)
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessId)
Timer1.Enabled = True
Timer1.Interval = 100
Picture1.Visible = True
'anmExport.Open App.Path & "\FILECOPY.AVI"
'anmExport.Play
'anmExport.Visible = True
Do
Call GetExitCodeProcess(hProcess, ExitCode)
System.Windows.Forms.Application.DoEvents()
Loop While (ExitCode = STILL_ACTIVE)
Call CloseHandle(hProcess)
'UPGRADE_WARNING: Screen property Screen.MousePointer has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6BA9B8D2-2A32-4B6E-8D36-44949974A5B4"'
'System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
System.Windows.Forms.Cursor.Current = Cursors.Default
'anmExport.Stop
'anmExport.Visible = False
Dim blnExportTerminatedsuccessfully As Boolean
Dim blnViewsExported As Boolean
Dim blnStoredProceduresExported As Boolean
Dim blnFileSize As Boolean
LogFileName = Mid(lblPath.Text, 1, InStr(1, lblPath.Text, ".") - 1) & ".log"
FileOpen(1, Mid(lblPath.Text, 1, InStr(1, lblPath.Text, ".") - 1) & ".log", OpenMode.Input)
Do While Not EOF(1)
Input(1, strline)
'UPGRADE_WARNING: Couldn't resolve default property of object strline. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If strline = "Export terminated successfully without warnings." Then
blnExportTerminatedsuccessfully = True
'UPGRADE_WARNING: Couldn't resolve default property of object strline. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
ElseIf strline = ". exporting views" Then
blnViewsExported = True
'UPGRADE_WARNING: Couldn't resolve default property of object strline. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
ElseIf strline = ". exporting stored procedures" Then
blnStoredProceduresExported = True
End If
Loop
FileClose(1)
k.v.s.s.kishore kumar
|
|
|
|
|
Hi,
I have an array declared as a structure. The structure has about 7 members (variables).
Is there a way to loop through the array and for each member check if it is null?
like this:
for i= 0 to array(index)
for each object array(index)
if is nothing ...
next
next
Thank you!
|
|
|
|
|
No.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
As Christian said it is not possible, but a handy method is to make a function called GetNulls() in your structure which returns null members. Now search through the array and get nulls.
|
|
|
|
|
Hi
I am using VB.2005 Express edition to develop a application. I can define my issue in parts
- What all Grid Controls are available. Is there only one “Data Grid View” grid control ?
- I wanted to use the grid control to display reports, this report is based on query from database, system state, user types and some more things. My issue is that i am not finding any way how to add data to Data Grid control. The only way i am finding is to link the column with some table. Cant i formulate a row on my own and add it in the grid.
- Is there any other control in which i can on my own formulate the data and display, the way we used to do in VB6 in MsFlexGrid or the Grid control
Regards
Nishkarsh
|
|
|
|
|
You create a DataSet and populate that with data from your database by using a DataApapter. You call the Fill method of the DataAdapter to get the data into the DataSet.
Now you can set the DataGridView.DataSource property to be a Table in your DataSet.
Dim ds As DataSet = New DataSet()
Dim cn As SqlConnection ... ' your connection string here.
cn.Open()
Dim cmd As New SqlCommand("SELECT * FROM TABLE",cn)
Dim da As New SqlDataAdapter(cmd)
da.Fill(ds,"tableName")
cn.Close()
Me.DGV.DataSource = ds.Tables("TableName")
The DataGridView is much more powerfull and usefull that the old MSFlexGrid (especially for bound data) and only takes a little patience to master.
Check for these terms in MSDN, Google or on Code Project for heaps of examples.
The Fanatical All Black Supporter - Kea Kaha
|
|
|
|
|
In this lotto project i am producing 6 nonrepeating random numberswith one procedure. when i call this to make 6 randomnumbers for 54 week it is giving the same numbers
the code is below
Sub randomNumbers(ByVal num As Integer)
Dim randomNum As New Random
Dim i As Integer
For i = 0 To num
rnd = randomNum.Next(1, 46)
If i = 0 Then
Numbers(i) = rnd
Else
For j As Integer = 0 To i - 1
If Numbers(j) = rnd Then
rnd = randomNum.Next(1, 46)
j = 0
Continue For
End If
Next
Numbers(i) = rnd
End If
Next
End Sub
Sub sorting()
Dim temp As Integer
For i As Integer = 0 To Numbers.Length - 2
For j As Integer = i + 1 To Numbers.Length - 1
If Numbers(j) < Numbers(i) Then
temp = Numbers(i)
Numbers(i) = Numbers(j)
Numbers(j) = temp
End If
Next
Next
End Sub
Private Sub bt56_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt56.Click
Dim i As Integer
'Dim num(5) As Integer
Dim ctr As Integer = 0
Me.Label1.Text = ""
For i = 1 To 54
Me.randomNumbers(5)
sorting()
For j As Integer = 0 To 5
fiftysixArray(ctr) = Numbers(j)
Numbers(j) = 0
ctr += 1
Next
Next
End Sub
|
|
|
|
|
Hi,
if you don't provide an explicit seed a random number generator will use the current time
as a seed, so everytime you create a new Random (within the same millisecond or so) it
will generate the same sequence.
Solution: insert a Thread.Sleep(1000) and/or provide a variable seed somehow
[added] or avoid creating new Randoms all the time (just have a single static one and
keep using it) [/added].
-- modified at 20:36 Friday 2nd November, 2007
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks Luc Pattyn . I got it corrected. Thanks for your solution
|
|
|
|
|
I am building a cash register with one textbox showing the item, another the price and another the quantity of that item being purchased.
How can I get a line in a listbox to show the price, quantity and item purchased?
Also, with another list box just containing the totals of each item purchased, how can I get a grand total with 2 decimal places?
Thank you
|
|
|
|
|
1 - by adding an item to the listbo
2 - by using the overload of ToString that takes a format specifier.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Don't understand the response can you please give an example
Thanks
|
|
|
|
|
ListBox1.Items.Add(new ListBoxItem(theStringYouWantInTheListBox);
decimal theAmount = 3.345234;
string currency = theAmount.ToString("c");
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi, I need to inherit my Form2 to Form3, when i use 'Inherits Form2' my form3 doesnt show up and I get this error message and I cannot view my Form3 design at all!
<br />
Warning 1 The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: <br />
<br />
Form3 --- The base class 'WindowsApplication1.Form2' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. 0 0 <br />
All i want to do is use some text out of a textbox in form2 and display it in a label on form3
Many thanks, Brad
|
|
|
|
|
Brad,
Try this:
vb.net 2003:
declare an instance of Form2 in Form3
Dim newForm2 As New Form2
label.text = newForm2.textbox.Text
vb.net 2005:
no need to declare an instance of Form2 in Form3
label.text = Form2.textbox.Text
Hope this helps.
Ken
|
|
|
|
|
Much love x
Thanks man! (y)
|
|
|
|
|
Hi All
I am working on a project at present i have half of it done already in VB.net server side but i require to use another language platform to code the client side to consume the XML and display the XML doc. Can anybody explain what i should be looking for to get started on this.
This is a crossplatform web service Client/Server with 2 different languages for instance i have done LoanCalcService in VB.Net server side and created with the use of XML doc and now just require to consume XML, SOAP, WSDL etc with another language platform client side and display. Please
Thank You Beforehand
|
|
|
|
|
I am having a problem with a few Crystal Reports that I can’t seem to track down. It is the same problem so I am sure that once I get one fixed then I can fix the same problem with the other. I am working with VB.Net 2005 and working with the CR (10.2.3600.0) version that ships with it.
My report looks at a single table in my Dataset. When I add or edit items in the program and then run the report they show up just fine. But when I delete an item and then run the report it still shows the item I deleted. I have to close out of my program and reopen then run the report before that item is removed.
I have verified that I am Updating and Filling the Dataset before I run the report. I tried creating a whole new report but it has the same problem. Can anyone help me with this?
|
|
|
|
|
I am new to web development, and to this point I have learned everything from help pages and forums like this. I have viewed many posts on submitting forms, but none seem to cover my problem. All I want to do is have users enter in information, and click submit so an email will be sent to me with their information. Nothing fancy. I tried following a suggestion using an email template and a "sendmail.asp" file. I kept getting this error:
----------
[HttpException (0x80004005): The HTTP verb POST used to access path '/Website/sendmail_cdo.asp' is not allowed.]
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +464
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +166
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +146
----------
Can someone please help me out. I am in over my head on this one.
Thank you.
-Christian
|
|
|
|