Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

teknozwizard

@teknozwizard
About
Posts
12
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • No Connection?
    T teknozwizard

    I'm trying to make a client to a text based game. I've asked the question before, but now I've got a little bit more to work with. What I need is some help with it. I'll show the code first. Code for my 'tcpListener' which I've actually added to my overall project as a Console Application - Module1

    Imports System.Net.Sockets
    Imports System.Text
    Module Module1
    Sub Main()
    Dim tcpListener As New TcpListener(6100)
    Dim requestCount As Integer
    Dim clientSocket As TcpClient
    tcpListener.Start()
    msg("Server Started")
    clientSocket = tcpListener.AcceptTcpClient()
    msg("Accept connection from client")
    requestCount = 0

        While (True)
            Try
                requestCount = requestCount + 1
                Dim networkStream As NetworkStream = \_
                        clientSocket.GetStream()
                Dim bytesFrom(10024) As Byte
                networkStream.Read(bytesFrom, 0, CInt(clientSocket.ReceiveBufferSize))
                Dim dataFromClient As String = \_
                        System.Text.Encoding.ASCII.GetString(bytesFrom)
                dataFromClient = \_
            dataFromClient.Substring(0, dataFromClient.IndexOf("$"))
                msg("Data from client -  " + dataFromClient)
                Dim serverResponse As String = \_
                    "Server response " + Convert.ToString(requestCount)
                Dim sendBytes As \[Byte\]() = \_
                    Encoding.ASCII.GetBytes(serverResponse)
                networkStream.Write(sendBytes, 0, sendBytes.Length)
                networkStream.Flush()
                msg(serverResponse)
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
        End While
    
    
        clientSocket.Close()
        tcpListener.Stop()
        msg("exit")
        Console.ReadLine()
    End Sub
    
    Sub msg(ByVal mesg As String)
        mesg.Trim()
        Console.WriteLine(" >> " + mesg)
    End Sub
    

    End Module

    And this is my code for the actual client

    Imports System.Net.Sockets
    Imports System.Text
    Public Class lokMudClient
    Dim clientSocket As New System.Net.Sockets.TcpClient()
    Dim serverStream As NetworkStream

    Private Sub btnConnect\_Click(ByVal sender As System.Object, \_
        ByVal e As System.EventArgs) Handles btnConnect.Click
        Dim serverStream As NetworkStream = clientSocket.GetStream()
        Dim buffSize As Integer
        Dim outStream As B
    
    Visual Basic question csharp game-dev sysadmin help

  • Looping Website Viewer?
    T teknozwizard

    John, really great resources for reviewing! Thanks so much!

    Visual Basic css question

  • Looping Website Viewer?
    T teknozwizard

    This is a wonderful solution and is greatly appreciated. Now all I have to do is figure out how to make it jump through proxies. I'm wondering, could I use the GetStream() function to try and make it jump through proxies?

    Visual Basic css question

  • Looping Website Viewer?
    T teknozwizard

    So glad this is trivial to an expert like yourself. However, being a beginner, the question still begs to differ. So, I go to using a timer, that's fine, but where do I begin? How do I launch the websites and make them rotate? Which function do I do? Obviously it won't be a Do- function. Where would you suggest I start? And since it's trivial, let's do it this way. I want to make the timers connect to and then jump through using proxy. I.E., when the program is first launched, I want it to connect to a predefined proxy server and run through all the websites one time. Then on it's return path (or loop if you will), I want it to connect to a second predefined proxy server and have it run through the websites like that, so forth and so on. Any suggestions for that?

    Visual Basic css question

  • [Message Deleted]
    T teknozwizard

    [Message Deleted]

    Java

  • Looping Website Viewer?
    T teknozwizard

    Say I wanted to create a small program that automatically rotated between websites every X seconds, where would I need to start? For instance, I create a simple form, it has 2 buttons. A start and a stop button. The stop button just quits the program completely, so I'm using the Me.Close() function for that, so I'm not worried about that. However, I want the start button to do something like.....open Google in Internet Explorer, and after say...45 seconds, rotate to Yahoo, and then another 45 seconds, rotate to MSN, and so forth and so on. Now, say I wanted the rotations to be less than 2 minutes, but more than 30 seconds, where would I start there? Would I use the Do/Loop functions?

    Visual Basic css question

  • Controversial Topic of Winsck and TCP/IP Connecting
    T teknozwizard

    Ian, This is some really great advice! Thanks so much for writing it for me. So far, I'm shocked and surprised that I get more help here than I do on the MSDN official VB forums with Microsoft, heh. I'm definitely checking into these things as of right this moment. Now, I do have a question, do you think it would be more beneficial for me to modulate the your suggestions, or should I privatize them and make them classes? Also, I'm including code below - upgraded I/O module - from Nerdy Mud Clients source code. Should I attempt to just copy/paste and credit that portion of the code to Nerdy, or are your suggestions above suggestions for I/O? I know that sounds like a stupid question and I apologize if it makes me look even more noobish. I know this project is definitely above my level, but I'm fully committed to seeing it through. To me, I feel that it's better to tackle something difficult and learn as much from it as possible than to keep with the smaller projects and learn little by little. Backwards logic, I know.

    Option Strict Off
    Option Explicit On
    Module mdlDataIO
    Dim cmdhistRow As Short
    Dim cmdhistNewPos As Short
    Dim cmdHistTmp As String
    Public arraycmdhist(30) As String
    Public Sub multisend(ByRef txt2send As String)
    frmMain.Winsock1.SendData(txt2send & vbCr)
    End Sub
    Public Sub File2Combo(ByRef sfile As String, _
    ByRef oList As System.Windows.Forms.ComboBox) _
    'this has been relocated from frmmain to help modularize and clean up code
    'it should be stable and complete
    Dim fnum As Short
    Dim sTemp As String
    fnum = FreeFile()
    oList.Items.Clear()
    FileOpen(fnum, sfile, OpenMode.Input)
    While Not EOF(fnum)
    sTemp = LineInput(fnum)
    oList.Items.Add(sTemp)
    End While
    FileClose(fnum)
    End Sub

    Public Sub cmdHistScrollup() 'stable/finalized
    	If CDbl(frmMain.lblSBH.Text) = 30 Then frmMain.lblSBH.Text = CStr(0)
    	If arraycmdhist(CInt(frmMain.lblSBH.Text)) = "" Then
            Do While arraycmdhist(CInt(frmMain.lblSBH.Text)) = "" \_
            And CDbl(frmMain.lblSBH.Text) < 30
                frmMain.lblSBH.Text = CStr(CDbl(frmMain.lblSBH.Text) + 1)
            Loop
    	End If
    	frmMain.txtInput.Text = arraycmdhist(CInt(frmMain.lblSBH.Text))
        If CDbl(frmMain.lblSBH.Text) <= 29 Then frmMain.lblSBH.Text = \_
        CStr(CDbl(frmMain.lblSBH.Text) + 1)
    End Sub
    
    Public Sub cmdhistscrollDown()
    
    Visual Basic csharp c++ sysadmin

  • Controversial Topic of Winsck and TCP/IP Connecting
    T teknozwizard

    Everyone, Thank you so much for your suggestions! Johan, I actually did not think of that. I don't have any block for winsck that would show whether or not the connection was connected or not. Ian and Dave, I did not think of having code to handle the I/O. The basic concept is that I want this one client to connect to the remove server (legendsofkrynn.wolfpaw.net) on the specified port (6100). So it would make sense that there would need to be something that needed to handle the I/O. Would you recommend I use a module or a class for the I/O handling? Also, which would actually be more prudent to use in my current quest? Winsck or TCP/IP? Many people say that with the development of VB 2008, there's no longer a need to use winsck, would anyone agree?

    Visual Basic csharp c++ sysadmin

  • Controversial Topic of Winsck and TCP/IP Connecting
    T teknozwizard

    I've posted this up on the MSDN in the VB section and it has sat there receiving 55 views and still no answers or suggestions. I'm hoping that maybe someone here can help me understand it and help me find a solution. Now, I've gone and I've bought at least 300 dollars worth of books and tried every example I could find on the internet and tried to learn on my own, but I've hit a snag that requires some expertise. I do not claim to be a great VB programmer, but I'm hoping that my skill will increase with time. It took a friend of mine 5 years to master C programming, and after he mastered it, it only took him 3 months to master C++ and C#. So, I have hope that I'll master VB faster than he mastered C. I have read - recently - many topics concerning the connection of TCP/IP connecting versus using the old winsck connecting method. Currently, I'm in the middle of a project and I'm completely lost as to which direction to go because I've tried both directions (winsck & TCP/IP) without any sort of avail. Currently, I am attempting to create my own mud client (as a reference, you could look at Nerdy Mud Client @ SourceForge - I'm trying to recreate the VB6 project using VB 2008 EE). Thus far, I've been able to appropriately get my forms together and working the way I wanted them. I've got the main form, with a window where the text output should be, I've got a text input bar and set it to AcceptsReturn True so people can type a message into the bar and hit enter to submit it, but for some reason, I can't get it to connect at all. I'd like it to actually connect to "legendsofkrynn.wolfpaw.net:6100." I keep finding tutorials on creating P2P chat clients and FTP clients, but that's not what I want. I want my client to talk to the server and receive information from the server, as well as send user input commands to the server. Currently, this is the code that I've got for my connection method.

    'Connects to legendsofkrynn.wolfpaw.net:6100
    Private Sub ConnectToolStripMenuItem_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles ConnectToolStripMenuItem.Click
    winsock1.Connect("legendsofkrynn.wolfpaw.net", 6100)
    End Sub

    Unfortunately, if this connects, it won't display the output into my mudViewer form (which is just a regular textbox set to multiline = true). Unfortunately as well, if this doesn't connect, I have no way to figure it out. Now, I've also tried....

    Visual Basic csharp c++ sysadmin

  • Event Driven Form
    T teknozwizard

    This is what I have currently: (1) My form (2) My menu bar with all the clicks I want on it (3) A text box docked at the bottom of the form This is what I'd like to happen: (1) On launch of the program - (i) I'd like for the program to ask a question, such as "What is your name?" (2) On the answer of that question based upon input from the text box (i) The first question to disappear (ii) A second question to replace the first question But I don't know how to make the text box docked to the bottom of the form input the text into the application and make the application continue to accept the responses and keep replacing the original question with a new question, etc. Can anyone help me with this?

    Windows Forms question help tutorial

  • Upgrade Failure?
    T teknozwizard

    I've got and tried to track through that filepath and.....nothing. I've done a system wide search and I don't have a file labelled "VB98" to try and find and get into to follow the rest of the path. I'm completely at a loss here. I thought that maybe it was looking for a library I didn't have so I went online and downloaded the libraries for VB2k8EE from microsoft's website and installed them, but unfortunately, I'm still having the same trouble....I can't copy the file's into the location because the location it's looking for them in doesn't seem exist and I'm not even sure what the full filepath would be because it gets cut off with the "\...\...\...\VB98\" and etc...I thank you for your response though.

    Visual Basic help csharp com question

  • Upgrade Failure?
    T teknozwizard

    Hi, I'm new to the programming world, but not the computer world. Anyway, I've just recently downloaded Visual Basic 2008 Express Edition, and so far I love it. However, I came across an old source file that's opensource on SourceForge.net and downloaded it. I was trying to upgrade the Project1.vbp using the VB2k8 Express upgrade wizard when it told me that the upgrade failed because the mdlFormHandling.bas file was missing. The problem is, I went into the folder and looked and it's not missing. It's right there. I took some screenshots to show you if anyone could please, please, please, please help me. I'm just a lowly college kid! No money for the big guns yet! >.< The Upload Error Screenshot - http://i927.photobucket.com/albums/ad117/teknozwizard/UpgradeError.jpg[^] File is there Screenshot - http://i927.photobucket.com/albums/ad117/teknozwizard/Fileisthere.jpg[^] Please help this newb!!!

    Visual Basic help csharp com question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups