|
i would like to know using what kind of codes or methodes in vb.net for pocket pc to limited the password can only be set in algha and num,no other symbols....
thanx
go ahead...do best on my works....
|
|
|
|
|
Well, you can use a regular expression to check, or you can create an input control that only accepts those characters.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
but u know.....so how to ? how to creat an input control ? could you pls give me some more details...
thanx...
go ahead...do best on my works....
|
|
|
|
|
Assuming none of the ones you'd find with google can help you...
Basically you derive a class from the input control, and handle the key press events. Use Char.IsLetterOrDigit to check if a key press is what you want, if it's not, then set the Handled property to true and the base method will not be called, therefore the key press will not be accepted.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how can i check my network is connected, pleaae help me, thanks
kevil
|
|
|
|
|
Hi!
You can use the sensapi.dll of the internet explorer to check if the network is been connected:
Private Declare Function IsNetworkAlive Lib "SENSAPI.DLL" (ByRef lpdwFlags As Long) As Long
This is the API declaration to access the IsNetworkAlive function within the sensapi.dll.
So, just use it like this:
Dim llReturn as Long
IF IsNetworkAlive(llReturn) = 0 THEN
' Not connected code
ELSE
' ... Your code (if connected)
End If
If you need more help, just let me know!
Marcel Erz
-- modified at 2:44 Tuesday 13th December, 2005
|
|
|
|
|
please, i need more help, can yuo give me sample
kevil
|
|
|
|
|
Hi!
Here an other example:
<br />
Private Declare Function IsNetworkAlive Lib "SENSAPI.DLL" (ByRef lpdwFlags As Long) As Long<br />
<br />
Private Const NETWORK_ALIVE_LAN = &H1 ' LAN connection<br />
Private Const NETWORK_ALIVE_WAN = &H2 ' RAS connection(for internet)<br />
<br />
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
Dim llReturn As Long<br />
<br />
If IsNetworkAlive(llReturn) = 0 Then<br />
MessageBox.Show("Your system is not connected!")<br />
Else<br />
If (llReturn And NETWORK_ALIVE_LAN) = NETWORK_ALIVE_LAN Then<br />
MessageBox.Show("Your system is connected to the LAN" + _<br />
" (may be over router to internet too)!")<br />
End If<br />
If (llReturn And NETWORK_ALIVE_WAN) = NETWORK_ALIVE_WAN Then<br />
MessageBox.Show("Your system is connected to the WAN by any" + _<br />
" kind of modem direct connected to you system!")<br />
End If<br />
End If<br />
End Sub<br />
If you need more help, just let me know!
Marcel Erz
|
|
|
|
|
If you're under VS2005/FW2 then it's very easy. There's a specific Application event that pop ups whenever network connection status changes.
|
|
|
|
|
It has been mentioned that .NET Framework 2.0 has the smarts to do this. Here's a brief rundown on what is required. I found the basis for this post at The Occasionally Connected Application[^].
I just setup a simple one-form app which had one label on it. The label is changed to "Connected" or "Not Connected" depending on the state of the network. The initial state is detected via this code in the Form_Load event ...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If My.Computer.Network.IsAvailable = True Then
lblConnectedStatus.Text = "Connected"
Else
lblConnectedStatus.Text = "Not Connected"
End If
End Sub
Now we need to dynamically test the connection state. This is done by creating an event handler for the NetworkAvailabilityChanged in the MyApplication class ...
Private Sub MyApplication_NetworkAvailabilityChanged(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.Devices.NetworkAvailableEventArgs) Handles Me.NetworkAvailabilityChanged
If e.IsNetworkAvailable = True Then
My.Forms.Form1.lblConnectedStatus.Text = "CONNECTED"
Else
My.Forms.Form1.lblConnectedStatus.Text = "Not Connected"
End If
End Sub
This passed most of the unplug / disable tests. Use this in conjunction with the new Ping functions in 2.0 and you may have a viable solution.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
Hi, I would like to use marquee in my program. Can its function be implemented in any of the control? How?
|
|
|
|
|
Yes, you can write a control that does marquee. Or if you google, I'm sure that one exists.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You could type "marquee" in the search box at the top of this page and find, as the second article, A marquee control in C#. You could just use the control, or translate it to VB.NET, usually a pretty trivial (and tedious) exercise. Just make sure to attribute the original author.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi,
i am using this site for a long time and i m a fan of this site. In our firm we have developed a web spider which can be downloaded at http://unicornsoftbd.com/download/index.php for free. If you use this web spider and give us a feed back,it will encourage us.If any of u want the source code please contact at info@unicornsoftbd.com.Thank u all.
|
|
|
|
|
I'm glad you find The Code Project a worthwhile resource. It has some great advice, code and help from many, many experienced developers.
Why not share your code on The Code Project, or even write an article with your web spider as the subject? That would put back a lot more into this community than simply advertising your own code on this board.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
-- modified at 18:50 Monday 12th December, 2005
|
|
|
|
|
Thank you for your quick repply.Actually i dont know how to post or publish an article in code project(though i use it... .If you give me this information i will gladly post this article in code project.
|
|
|
|
|
Have a look at How to submit an article.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I can successfully create registry keys (createkey)in debug mode of my project, but the key values set with (SetKey) don't seem to change, they always show up as default 0 when inspecting with regedit. The keys are there, but the values are always 0. I tried flush and close. I have tried rebooting and still the values are default 0 in regedit.
Crazy thing is, when changing the registry values through my project UI, they appear to succesfully change in the UI, even after reboot of the computer, but when I go to look in Regedit, the default 0 is still there. Does VS work with a copy of the registry that will not show up in regedit???
Thanks,
Depotdog
|
|
|
|
|
I'm using the System.net.WebClient class to post a file as http through the company firewall to an external company.
To get throught the firewall I need to set the proxy creadentials. For http this works fine. My question is that if I want to send over https and need to set basic authentification for the destination system, how do I specify that? Not pretty but can I include it in the pDestination string? If I set the Credentials property of the WebClient object does that overwrite the proxy credentials?
' set proxy
Dim vProxy As WebProxy = System.Net.WebProxy.GetDefaultProxy
vProxy.Credentials = New NetworkCredential(vUsername, vPassword, vDomain)
GlobalProxySelection.Select = vProxy
' send file as http(s)
Dim vWebClient As New System.Net.WebClient
vResponseArray = vWebClient.UploadFile(pDestination, "POST", pFilePath)
|
|
|
|
|
well i have made a form which has buttons on it which link to different .exe, but i want to be able to add more button when i need to E.G. when i install a new game. without going in to Vb. on the form i want to be able to add and delete.
i also want to know how to make this form once completed run when windows start up.
p.s im using Microsoft Visual Basic 2005 Express Edition
-- modified at 8:53 Monday 12th December, 2005
|
|
|
|
|
HI!
You can create a new instance of the Button-class. Here an example:
' Counter for all buttons
Dim liButtonCount As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' create new button
Dim foNewButton As New System.Windows.Forms.Button()
With foNewButton
' give the new object a name to find out which button pressed later
.Name = "NewButton" + liButtonCount.ToString
' set some properties like text, size and location
.Text = "NewButton " + liButtonCount.ToString
.Location = New System.Drawing.Point(1, liButtonCount * 40)
.Size = New System.Drawing.Size(120, 40)
.Visible = True ' set it as visible
' add the new button to the control list of the container (the formular)
Me.Controls.Add(foNewButton)
' add the destination sub to the event handler of the button (execute sub when get fired)
AddHandler .Click, AddressOf NewButtons_Click
End With
' increment the counter for the next new button
liButtonCount = liButtonCount + 1
End Sub
' multiple event sub for all dynamical created buttons
Private Sub NewButtons_Click(ByVal sender As Object, ByVal e As System.EventArgs)
' just to work easier with the object
Dim loButton As System.Windows.Forms.Button = sender
' find out which button was pressed
Select Case loButton.Name
Case "NewButton0" : MessageBox.Show("This is new Button number 0")
Case "NewButton1" : MessageBox.Show("And this is new Button number 1")
' you can go on like this for every button...
End Select
End Sub
I hope I could help you! If you need more help with it, just let me know!
Marcel Erz
|
|
|
|
|
1. you asked this yesterday
2. the answer remains the same.
First of all, to do this you need to add some sort of config file. How else can you edit what the program does without editing the program
Secondly, what you're doing is really dumb. Just create shortcuts to your games and put them in a folder on the desktop if you want them all linked to one place.
And finally, as you were told yesterday, you add your program to the startup folder on the start menu and it will run on startup.
If you can't understand the answer, ask whoever gave it to you, don't repost the question.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have:
Combo1.AddItem "15", 0
Combo1.AddItem "22.5", 1
Combo1.AddItem "40", 2
Combo1.AddItem "50", 3
Combo1.AddItem "62.5", 4
Combo1.AddItem "75", 5
Combo1.AddItem "90", 6
and when the code runs I want to see the item "40" showing in the combobox. It should also know that the index of this item is 2.
thnaks,
sb
|
|
|
|
|
Hi!
Just use the Listindex-property! Example:
Combo1.Listindex = 2
This example will select the 3. entry in the list, like you wanna do it. But be sure that there are enough entries in the list.
Marcel Erz
|
|
|
|
|
Combo1.ListIndex=2
That's it.
Amin.
|
|
|
|