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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 2,373
» Latest member: alexsshulzeo7595
» Forum threads: 848
» Forum posts: 3,635

Full Statistics

Online Users
There is currently 1 user online
» 0 Member(s) | 1 Guest(s)

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

 
  can someone help me out?
Posted by: andrei.xd23 - 05-08-2013, 12:20 AM - Forum: Java - Replies (2)

Code:
import java.util.Scanner;


public class test3 {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args)
    {
        String a = "Warrior";
        System.out.println("What are we?\na.Warriors\nb.Mages\nc.Noobs");
        String answer = sc.nextLine();
        if (a == answer)
        {
            System.out.println("That's fucking correct. Let's move on");
        }
        else
        {
            System.out.println("Wrong. That's just wrong");
        }
    }
}
ok so i made this code.. but something doesn't work properly ... i mean when i press run anything i write down it's incorrect..

Print this item

  Cool Website
Posted by: Ecnarf - 05-02-2013, 01:25 PM - Forum: Off-Topic - No Replies

Join VipLeakForums, it is a great site with a cool community.

Print this item

  Very New to Programming Need advice .
Posted by: pwsincd - 05-02-2013, 11:15 AM - Forum: Programming Help - Replies (8)

Hi guys , i trying to develop an app for my son so he can easily admin a mysql database , and after lots of googleing i eventually came across brandons youtube tutorials on sql connection .. Thanks for those man , very helpful.

I have progressed quite well but it seems i have over looked something.

I wanted to make the app useful to others so rather than predetermine the connection string i thought to add simple textbox entries for connection to other DB's of this nature.

Ok so to my problem . to aid in debugging i predetermined the connection string variables to save me typing them in. Now that im ready to try the app i remove the predetermined variable strings and want the textbox entries to come into play.

heres my code :

[code2=vbnet]Imports MySql.Data.MySqlClient

Public Class Form1
'common variables
Public Shared IP As String = "removed for security"
Public Shared DBNAME As String = "removed for security"
Public Shared USER As String = "removed for security"
Public Shared PASS As String = "removed for security"
Public Shared conn_ok As Boolean = False
Public Shared connstr As String = "Server=" & IP & ";Database=" & DBNAME & ";Uid=" & USER & ";Pwd=" & PASS & ";"
Public Shared myConnection As New MySqlConnection(connstr)
Public Shared command As New MySqlCommand
Public Shared adapter As New MySqlDataAdapter
Public Shared data As MySqlDataReader

'connection code
'ip address
Private Sub KryptonTextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles KryptonTextBox1.TextChanged
IP = KryptonTextBox1.Text
connstr = "Server=" & IP & ";Database=" & DBNAME & ";Uid=" & USER & ";Pwd=" & PASS & ";"
End Sub
'Database name
Private Sub KryptonTextBox2_TextChanged(sender As System.Object, e As System.EventArgs) Handles KryptonTextBox2.TextChanged
DBNAME = KryptonTextBox2.Text
End Sub
'username
Private Sub KryptonTextBox3_TextChanged(sender As System.Object, e As System.EventArgs) Handles KryptonTextBox3.TextChanged
USER = KryptonTextBox3.Text
End Sub
'password
Private Sub KryptonTextBox4_TextChanged(sender As System.Object, e As System.EventArgs) Handles KryptonTextBox4.TextChanged
PASS = KryptonTextBox4.Text
End Sub
'connection test
Private Sub KryptonButton1_Click(sender As System.Object, e As System.EventArgs) Handles KryptonButton1.Click
' check connection by retrieving sql version
KryptonRichTextBox1.Text = ""
Dim stm As String = "SELECT VERSION()"
Dim Version As String = ""
Try
myConnection.Open()
TextBox1.Text = "Server=" & IP & ";Database=" & DBNAME & ";Uid=" & USER & ";Pwd=" & PASS & ";"
Dim cmd As MySqlCommand = New MySqlCommand(stm, myConnection)
Version = Convert.ToString(cmd.ExecuteScalar())

KryptonRichTextBox1.Text = "Successful connection : connected to PermissionsEx database version : " & Version
conn_ok = True

Catch ex As MySqlException
KryptonRichTextBox1.Text = "Connection Error : Please verify your database info is correct and your internet connection is valid."
conn_ok = False
TextBox1.Text = "Server=" & IP & ";Database=" & DBNAME & ";Uid=" & USER & ";Pwd=" & PASS & ";"
Finally
myConnection.Close()
End Try
' if connection is ok then check db tables exist
If conn_ok = True Then
Try
Dim sqlquery As String = "SELECT * from permissions"
myConnection.Open()
command.CommandText = sqlquery
command.Connection = myConnection
adapter.SelectCommand = command
data = command.ExecuteReader
Catch extable As MySqlException
KryptonRichTextBox1.Text = "Successful connection : connected to mySQL database version : " & Version & ". However no Permissions EX tables are present , please check your database configuration."
Finally
myConnection.Close()
End Try
Else
KryptonRichTextBox1.Text = "Connection Error : Please verify your database info is correct and your internet connection is valid."
End If
End Sub[/code2]

The problem seems to be that if i run my app and hit my connect button without populating the textboxes it connects using my predetermined values no problems.
If i remove my predetermined values and rely on the textboxes connection fails.

I displayed the connection string in a new textbox to see what was going on , when i connect to the db my outputted textbox string is missing the variables , if i fail to connect using the textboxes , the connection string in the debug textbox is fine .

basically what im saying is i cannot seem to push the textbox entries into a successful connection string.

If screenshots of the app would help let me know.

Print this item

  Help with the java code
Posted by: Helljbb1234 - 05-01-2013, 06:12 AM - Forum: Programming Help - No Replies

I need help this has to be before mothers day. Can anyone tell me the java code so I can make java read an audio file or is it the same as making it read a text file I am using eclipse

Print this item

  NetvOS project
Posted by: MjDev - 05-01-2013, 12:23 AM - Forum: Share your programs! - Replies (6)

Hi guys! This is my first time posting here <!-- sSmile --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt="Smile" title="Smile" /><!-- sSmile -->
Although my progrma is still in development I wanted to share it. In short it's a kind of full screen dekstop interface (a bit like the windows 8 start screen). Alot of work still has to be done... Suggestions are welcome!

Features:
-Create infinite user accounts (saved as a 'username'.ac file)
-Password are encrypted in 'username'.ac file
-Snap to grid tiles at 'Platform'

A download link can be found here: <!-- m --><a class="postlink" href="http://netvos.zxq.net/download/v6.5.zip">http://netvos.zxq.net/download/v6.5.zip</a><!-- m -->



Attached Files Thumbnail(s)
   
Print this item

  Calculator
Posted by: Aaron Rogers118 - 04-28-2013, 07:05 PM - Forum: Programming Help - Replies (4)

I'm slowly learning java, mostly from Brandonio21's videos, and I have run into a problem. I need to know what I need to do with this code:
[code2=java]package howto;

import javax.swing.JOptionPane;

public class Calculator {

public static void main(String[] args)
{
JOptionPane myIO = new JOptionPane();
double inputText = myIO.showInputDialog("Please enter length:");
double lingth = inputText;
double inputText1 = myIO.showInputDialog("Please enter length:");
double width = inputText1;

double area = (lingth * width) / 2;

JOptionPane.showMessageDialog(null, "The area of the triangle is: " + area);
}
}[/code2]
I need help soon because it is for a school project called "How to".

Print this item

  How do I go about doing this?
Posted by: Ecnarf - 04-22-2013, 03:52 PM - Forum: Programming Help - Replies (1)

I am trying to make it so that a button remains held down rather then pressed using a timer, but I can't figure it out. If someone could tell me if this is possible or not I would appreciate it. Thanks!

Print this item

  How to play random .wav files with a button click
Posted by: STrooper501 - 04-17-2013, 03:32 PM - Forum: Programming Help - No Replies

Seems like it should be relatively simple, but I can't quite get it. I want to create a series of buttons that each play a random .wav file from a different category. I have all my .wav files grouped into different directories based on the button I want them to be associated with. I have been able to make a singular .wav file play when I click the button but I want it to be different audio file each time I click it.

Edit: I suppose I should mention that while I'm pretty good with a computer I'm COMPLETELY new to anything programming related. So just assume I know little to nothing when it comes to explaining things. Thanks for any help!

Print this item

  Reading material..
Posted by: Knight - 04-14-2013, 12:14 PM - Forum: Java - No Replies

Hey all.

Except Brandonio's great videos, can please tell me reading/video materials. That are good too.

Best would be, basics and than jdbc.
Main thing, that i wan't to learn is make application (Chat) and use my design => <!-- m --><a class="postlink" href="http://screencloud.net/v/wQH9">http://screencloud.net/v/wQH9</a><!-- m -->

Terms? Things what i need to know? Tips?

I will appriciate all. <!-- sSmile --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt="Smile" title="Smile" /><!-- sSmile -->

Print this item

  Properties
Posted by: brandonio21 - 04-11-2013, 05:20 PM - Forum: Code Snippets - Replies (1)

Properties are essential if you are creating a custom object. Essentially, properties are the things that can be edited in the "visual designer" - all of the things that are accessible via the properties window in the lower right hand corner of Visual Studio.

Adding basic properties to your form is easy. All you need is an instance variable and a property block. Then you're all set. For example, here is a sample property arrangemenet:
[code2=vbnet]Private _messageString As String
Public Property MessageString As String
Get
Return _messageString
End Get
Set(value As String)
_messageString = value
End Set
End Property[/code2]

Of course, in this example we use a String object. In the real world, any object can be used. After this is added to your object, the user will be able to edit the properties via the properties Window and give this variable a specific value.

What if you wanted to give the user a list of options to choose from, though? This can be doing by combining properties with enumerations. Thus:
[code2=vbnet]Private _messageString As messageIdentifier
Public Property MessageString As messageIdentifier
Get
Return _messageString
End Get
Set(value As messageIdentifier)
_messageString = value
End Set
End Property

Enum messageIdentifier As Integer
Greetings = 1
Goodbyes = 2
Warning = 3
Declaration = 4
End Enum[/code2]

Although the above code snippet may seem rather ridiculous since the Enumerations don't actually correspond to anything, this is a way of offering the user a list of options to choose from. In this case, the list will contain "Greetings", "Goodbyes", "Warning", and "Declaration". You can then work with this choice by processing the enumeration in some way, as such:
[code2=vbnet]Private Function GetMessageString() As String
If (_messageString = messageIdentifier.Declaration) Then
Return "Of Independence"
ElseIf (_messageString = messageIdentifier.Goodbyes) Then
Return "It has been a fun time, but I must leave you."
ElseIf (_messageString = messageIdentifier.Greetings) Then
Return "Salutations, my good man/woman"
ElseIf (_messageString = messageIdentifier.Warning) Then
Return "Back off! You have no business in this area."
Else
Return ""
End If
End Function[/code2]


Thus, it is really easy to give the user the ability to edit properties when they add your custom control to their form. The only downside occurs when you update a property to be a different object, but do not change the value of the property. Massive errors ensue.

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

Feel free to download a sample project:
[attachment=0]<!-- ia0 -->PropertyTutorial.zip<!-- ia0 -->[/attachment]



Attached Files
.zip   PropertyTutorial.zip (Size: 74.13 KB / Downloads: 611)
Print this item