Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 2,399
» Latest member: Jamiequado
» Forum threads: 848
» Forum posts: 3,635

Full Statistics

Online Users
There are currently 2 online users.
» 0 Member(s) | 1 Guest(s)
Bing

Latest Threads
Hangman in Rust
Forum: Other
Last Post: brandonio21
02-04-2018, 11:14 AM
» Replies: 2
» Views: 18,437
How to: Search files from...
Forum: VB.NET
Last Post: brandonio21
11-25-2017, 12:55 PM
» Replies: 1
» Views: 14,074
Database error anyone hel...
Forum: VB.NET
Last Post: brandonio21
11-25-2017, 12:46 PM
» Replies: 2
» Views: 15,892
Character ammount
Forum: Java
Last Post: brandonio21
04-28-2016, 02:13 PM
» Replies: 1
» Views: 17,806
RunAsAdmin
Forum: VB.NET
Last Post: brandonio21
04-15-2016, 11:11 AM
» Replies: 2
» Views: 20,168
Krypton Toolkit Download
Forum: VB.NET
Last Post: brandonio21
03-28-2016, 07:55 PM
» Replies: 0
» Views: 10,885
Adding backgroundcolor to...
Forum: Java
Last Post: brandonio21
09-01-2015, 10:09 PM
» Replies: 1
» Views: 14,507
Using a string as an alia...
Forum: VB.NET
Last Post: brandonio21
06-20-2015, 09:00 PM
» Replies: 1
» Views: 13,420
Read all lines from multi...
Forum: VB.NET
Last Post: strawman83
06-04-2015, 08:54 AM
» Replies: 2
» Views: 17,513
Filter each cell in dgv
Forum: VB.NET
Last Post: brco900033
05-08-2015, 09:51 AM
» Replies: 4
» Views: 22,477

 
  Making Your Program Start with Windows
Posted by: brandonio21 - 04-09-2013, 03:10 PM - Forum: Code Snippets - No Replies

I know I have received several PMs and emails regarding making your VB.NET application start with Windows, and I finally got around to creating a nice code snippet.

The first thing you need to do is as the "Windows Script Host Object Model" COM object as a reference to your project. This is very important.

Next, you will want to import the reference:
[code2=vbnet]Imports IWshRuntimeLibrary[/code2]

Now you're good to go and you can start your application with Windows. Essentially, this code will create a shortcut in the users "Startup" folder, forcing Windows to start the application when the computer is turned on.

This code will create the shortcut/start the program with Windows:
[code2=vbnet]'create path variables
Dim startupPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
Dim executablePath As String = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
Dim executableName As String = System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName
'create shortcut
Dim Shell As WshShell
Dim Link As WshShortcut
Try
Shell = New WshShell
Link = CType(Shell.CreateShortcut(startupPath & "\" & executableName & ".lnk"), IWshShortcut)
Link.TargetPath = executablePath
Link.Save()
Catch ex As Exception
MsgBox(ex.Message)
End Try[/code2]

This code will remove the shortcut/stop the program from starting with Windows:
[code2=vbnet]Dim startupPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
Dim executableName As String = System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName

Dim directoryInfo As New System.IO.DirectoryInfo(startupPath)
Dim fileInfo() As System.IO.FileInfo
fileInfo = directoryInfo.GetFiles("*.lnk")
For Each file As System.IO.FileInfo In fileInfo
If (file.FullName.Contains(executableName)) Then
file.Delete()
End If
Next[/code2]


Optionally, you can eliminate the deletion of files with similar names by changing file.FullName.Contains(executableName) to file.FullName.Equals(executableName)


Watch the video here: <!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=VpPqPtTjMzQ&feature=youtu.be">http://www.youtube.com/watch?v=VpPqPtTj ... e=youtu.be</a><!-- m -->


[attachment=0]<!-- ia0 -->StartupTest.zip<!-- ia0 -->[/attachment]



Attached Files
.zip   StartupTest.zip (Size: 91.73 KB / Downloads: 660)
Print this item

  Mobile Development
Posted by: dmarks2061 - 04-07-2013, 06:48 AM - Forum: Programming Help - No Replies

I want to do some 'droid development and I'm looking for the best way to get up to speed quickly. Everybody says Java is the way to go, but I'd like to find a 'trail' that will get me there. "There's an app for that," right? I want to write some of those apps and publish them in the Play Store. Any suggestions?

Print this item

  Adjustable Screen Shot Taker
Posted by: Wannabeprogramer - 04-04-2013, 07:39 AM - Forum: Request a Video - Replies (1)

I have been wanting to find out how to make a screen shot program. Please make a video about how one could make a screen shot program that doesn't show the program while you take the picture. If you would that would be great man... I LOVE YOUR VIDEOS!!!! <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->

Print this item

  I am getting problem with brandonio's registration form...
Posted by: mnxford - 03-26-2013, 11:55 AM - Forum: Programming Help - Replies (1)

hello guys,

Following the tutorials of brandonio i made a registration form and tried to give some additional features to it.

Here the code of the registration form:
[code2=vbnet]Imports System.Windows.Forms
Imports MySql.Data.MySqlClient
Public Class registrationForm
Public conn As MySqlConnection
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
conn = New MySqlConnection(ServerString)

'/ Username existing verification
If tbx_username.Text = Nothing Or tbx_password.Text = Nothing Or tbx_conPassword.Text = Nothing Or tbx_email.Text = Nothing Or tbx_realname.Text = Nothing Then
MsgBox("Please fill up all the fields.", MsgBoxStyle.Information, "Error")
Else
Dim Username As Boolean = True
Dim Email As Boolean = True
conn.Open()
Dim sqlquery As String = "SELECT * FROM reg_members WHERE Username = '" & tbx_username.Text & "';"
Dim data As MySqlDataReader
Dim adapter As New MySqlDataAdapter
Dim command As New MySqlCommand
command.CommandText = sqlquery
command.Connection = conn
adapter.SelectCommand = command
data = command.ExecuteReader
While data.Read()
If data.HasRows() = True Then
MsgBox("Username is already in use!", MsgBoxStyle.Exclamation, "Error")
Username = False
data.Close()
Else
data.Close()
Username = True
End If
End While
data.Close()

'/ Email existing verification
Dim sqlquery2 As String = "SELECT * FROM reg_members WHERE Email = '" & tbx_email.Text & "';"
Dim data2 As MySqlDataReader
Dim adapter2 As New MySqlDataAdapter
Dim command2 As New MySqlCommand
command2.CommandText = sqlquery2
command2.Connection = conn
adapter2.SelectCommand = command2
data2 = command2.ExecuteReader
While data2.Read()
If data2.HasRows() = True Then
MsgBox("Email is already in use!", MsgBoxStyle.Exclamation, "Error")
Email = False
data2.Close()
Else
data2.Close()
Email = True
End If
End While
data2.Close()

'/ Data entry section
If Not tbx_conPassword.Text = tbx_password.Text Then
MsgBox("Password doesn't match!", MsgBoxStyle.Critical, "Error")
Else
If Username = True And Email = True Then
Dim sqlquery3 As String = "INSERT INTO reg_members (Username, Password, Email, FullName)VALUES ('" & tbx_username.Text & "','" & tbx_password.Text & "','" & tbx_email.Text & "','" & tbx_realname.Text & "')"
Dim data3 As MySqlDataReader
Dim adapter3 As New MySqlDataAdapter
Dim command3 As New MySqlCommand
command3.CommandText = sqlquery3
command3.Connection = conn
adapter3.SelectCommand = command3
data3 = command3.ExecuteReader
MsgBox("You have successfully registered! Now you can log in.", MsgBoxStyle.Information, "Registration Successful")
Me.Close()
loginForm.Show()
End If
End If
End If
End Sub

Private Sub tbx_conPassword_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbx_conPassword.TextChanged
If Not tbx_conPassword.Text = tbx_password.Text Then
Label8.Text = "Password doesn't match."
Else
Label8.Text = ""
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
tbx_username.Clear()
tbx_password.Clear()
tbx_conPassword.Clear()
tbx_email.Clear()
tbx_realname.Clear()
End Sub
End Class[/code2]

I have added the features to say email already exist as the login form already says that username already exist...but it works only for the username but not for the email address....after trying the code it gives an error of db conn close needed or open neeede or already opened such type of errors...

Please help me how can I solve this problem and what is the solved code.Please provide me the correction of this code...

Brandonio bro needs your help.....
Thanks in advance.......

Print this item

  i am getting a problem with brandonio's login form
Posted by: mnxford - 03-26-2013, 11:51 AM - Forum: Programming Help - Replies (1)

hello guys,

Following the tutorials of brandonio i made a login form and tried to give some additional features to it.

Here the code of the login form:

Code:
Imports MySql.Data.MySqlClient
Public Class loginForm
    Public conn As MySqlConnection

    Private Sub loginButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles loginButton.Click
        conn = New MySqlConnection(ServerString)
        Select Case ComboBox1.Text
            Case "Normal Member"
                If txtUsername.Text = Nothing Or txtPassword.Text = Nothing Then
                    MsgBox("Please fill up all the fields.", MsgBoxStyle.Information, "Error")
                Else
                    Me.Cursor = Cursors.AppStarting
                    Try
                        conn.Open()
                        Dim sqlquery As String = "SELECT * FROM reg_members"
                        Dim data As MySqlDataReader
                        Dim adapter As New MySqlDataAdapter
                        Dim command As New MySqlCommand
                        command.CommandText = sqlquery
                        command.Connection = conn
                        adapter.SelectCommand = command
                        data = command.ExecuteReader
                        While data.Read()
                            If data.HasRows() = True Then
                                If Not data(1).ToString = txtUsername.Text Then
                                    MsgBox("Login Failed. Account doesn't exist. Please register to log in.", MsgBoxStyle.Critical, "Error")
                                Else
                                    If data(2).ToString = txtPassword.Text Then
                                        MsgBox("You have successfully logged in.", MsgBoxStyle.Information, "Login Successful")
                                        Me.Close()
                                        normalMemberForm.Show()
                                    Else
                                        MsgBox("Login Failed. Incorrect password. Please try again.", MsgBoxStyle.Critical, "Error")
                                    End If
                                End If
                            Else
                                MsgBox("Login Failed. Incorrect password. Please try again.", MsgBoxStyle.Critical, "Error")
                            End If
                        End While
                    Catch ex As Exception
                    End Try
                End If
            Case "Official Member"
                If txtUsername.Text = Nothing Or txtPassword.Text = Nothing Then
                    MsgBox("Please fill up all the fields.", MsgBoxStyle.Information, "Error")
                Else
                    Me.Cursor = Cursors.AppStarting
                    Try
                        conn.Open()
                        Dim sqlquery As String = "SELECT * FROM off_members"
                        Dim data As MySqlDataReader
                        Dim adapter As New MySqlDataAdapter
                        Dim command As New MySqlCommand
                        command.CommandText = sqlquery
                        command.Connection = conn
                        adapter.SelectCommand = command
                        data = command.ExecuteReader
                        While data.Read()
                            If data.HasRows() = True Then
                                If Not data(1).ToString = txtUsername.Text Then
                                    MsgBox("Login Failed. Account doesn't exist. Please register to log in.", MsgBoxStyle.Critical, "Error")
                                Else
                                    If data(2).ToString = txtPassword.Text Then
                                        MsgBox("You have successfully logged in.", MsgBoxStyle.Information, "Login Successful")
                                        Me.Close()
                                        officialMemberForm.Show()
                                    Else
                                        MsgBox("Login Failed. Incorrect password. Please try again.", MsgBoxStyle.Critical, "Error")
                                    End If
                                End If
                            Else
                                MsgBox("Login Failed. Incorrect password. Please try again.", MsgBoxStyle.Critical, "Error")
                            End If
                        End While
                    Catch ex As Exception
                    End Try
                End If
        End Select
    End Sub

    Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
        Me.Close()
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        loginButton.Enabled = True
        loginButton.Select()
    End Sub
End Class

I have added the features to say the user doesn't exist in the login form....but it works great with the off_members but when using the reg_members after login i get the error of user doesn't exist many times....

Please help me how can I solve this problem and what is the solved code.....

Brandonio bro needs your help.....

Print this item

  How can I get the server status???
Posted by: mnxford - 03-25-2013, 11:44 AM - Forum: Programming Help - Replies (5)

Hello guys,

I want my software that it will contain a server status dialog. When a user will click on the server status then a dialog will open in which they will be able to see if the MySQL server with this software in online or offline.

I need a code that will open a db connection and if connection open the show a circle with green color and say green color Online and if db connection timeout then they will get a the circle red and red Offline text and this will happen if their internet connection is not available....and if their internet connection available but my MySQL server is down then they will get a yellow color on the circle and will say server offline...

Please provide me the code by which I can do this...

Thanks in advance.....

Print this item

  Personal Code Repository
Posted by: xolara - 03-24-2013, 03:33 PM - Forum: Share your programs! - Replies (4)

This is a Code Repository if you have a code you find useful and may wanna keep it somewhere it wont get lost then this program can help you out

Here is some pictures

Main Form
http://i46.tinypic.com/1f92j6.png
[Image: 311l7y1.png]

Edit Form
http://i46.tinypic.com/1f92j6.png
[Image: 1f92j6.png]

[attachment=0]<!-- ia0 -->Code Repository.zip<!-- ia0 -->[/attachment]



Attached Files
.zip   Code Repository.zip (Size: 330.31 KB / Downloads: 628)
Print this item

  How to put buttons in the non-client area?
Posted by: Derek275 - 03-24-2013, 08:37 AM - Forum: VB.NET (Visual Basic 2010/2008) - Replies (4)

So, I am starting to work on a new project. What I'm planning on doing is to save space on my navigation area so I want to put the options menu in the non-client area (The area where the title and close buttons are, in case I'm not using the right term)
How would I do this?
Thank you for any help <!-- sBig Grin --><img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt="Big Grin" title="Very Happy" /><!-- sBig Grin -->

Print this item

  Loading and Displaying Images
Posted by: brandonio21 - 03-21-2013, 03:44 PM - Forum: Code Snippets - No Replies

This is the source code for my Java tutorial discussing how to load and display images in a Java applet.

Here's the video:
<!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=oXmUp4ZTW2Q">http://www.youtube.com/watch?v=oXmUp4ZTW2Q</a><!-- m -->

Source code:
[code2=java]import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Toolkit;
import java.net.URL;

public class ImageLoadingTutorial extends Applet
{

private Image spiral = null;

public void paint(Graphics g)
{
this.setSize(640, 480);

if (spiral == null)
spiral = getImage("spiral.png");

Graphics2D g2 = (Graphics2D)g;
g2.drawImage(spiral, 25, 50, 25, 25, this);
}


public Image getImage(String path)
{
Image tempImage = null;
try
{
URL imageURL = ImageLoadingTutorial.class.getResource(path);
tempImage = Toolkit.getDefaultToolkit().getImage(imageURL);
}
catch (Exception e)
{
System.out.println("An error occured - " + e.getMessage());
}
return tempImage;
}

}[/code2]

Pastebin link: <!-- m --><a class="postlink" href="http://pastebin.com/sdBqqdxK">http://pastebin.com/sdBqqdxK</a><!-- m -->

Print this item

  How can I set profile for a user???
Posted by: mnxford - 03-19-2013, 11:32 AM - Forum: Programming Help - Replies (5)

Hello,
I watched all the brandonio's video tutorials on youtube..

I worked according to his video tutorials. And now I have some problem. I did every single user login,registration etc seeing brandonio's videos...now how can I set a profile for my user...

As for example when a user will log in and will get his profile..only his profile...he will not see other's profile...andhow can he set up his avater which will be connected with the database...profile will also retrieve info from db....

Please help me...

Thanks in advance.....

Print this item