Serverless IP Chat [.NET 2005]
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: Serverless IP Chat [.NET 2005]

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Serverless IP Chat [.NET 2005]

    Well almost everyone knows about the VB6 Version of IP Chat that i've been developing. Well for the past few weeks i've been working on a .NET version to help me hone my skills..

    This version is far from complete and only has the user login and general chat modules done, And as per the VB6 App... this is a open source Progect that i'm opening up to all members to comment on..

    Enjoy...

    Gremmy...

    --- EDIT ---
    Newer file on later post (87 Downloads)..
    Last edited by GremlinSA; June 25th, 2007 at 02:04 PM.
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Serverless IP Chat [.NET 2005]

    Hmm I'm Dissapointed..

    Over 60 Downloads and no comments..

    Well anyways, I've been busy working on this, and a update will be available soon, Currently writing the TCP Socket Class for file transfers.. Hope to complete it soon..

    Watch this space ...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Sep 2000
    Location
    FL
    Posts
    1,451

    Re: Serverless IP Chat [.NET 2005]

    I just downloaded it. Haven't experimented much but saw the comment on the login about INI or registry.

    I would say Registry. Probably 2 keys localmachine for subnet, ip,port and currentuser for username. You can start to add other to the user like color...

    Anyway, here is a class to get you started.

    And new code for your login page.

    Code:
    ' Generealy the First MDI Child form that a user will see. Handles the initial
    ' Network and user setups..
    'Also handles the visibility of the Login/Logout menu items on the Main form..
    
    Public Class Login_page
        Private Tmp_loop As Integer
        Private Logged As Boolean
        Private DefaultInfo As New clsUserInfo
        Public Event Login_event(ByVal Login As Boolean)
    
        Private Sub Login_page_Deactivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Deactivate
            Main_F.LoginToolStripMenuItem.Enabled = Not Logged
            Main_F.LogoutToolStripMenuItem.Enabled = Logged
            ReDim User(0)
            With User(0)
                .Hidden = False
                .Ignore = False
                .IP = (Net.IPAddress.Parse(ComboBox1.Items(ComboBox1.SelectedIndex).ToString))
                .Name = TextBox3.Text
            End With
            Subnet = Net.IPAddress.Parse(TextBox1.Text)
            L_Port = CInt(TextBox2.Text)
            ' Must save to Reg or INI file too
            RaiseEvent Login_event(Logged)
        End Sub
    
        Private Sub Login_page_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        End Sub
    
        Private Sub Login_page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            DefaultInfo.Load()
            Main_F.LoginToolStripMenuItem.Enabled = False
            Main_F.LogoutToolStripMenuItem.Enabled = False
            Dim Connections As ArrayList
            Connections = GetLIPAdresses()
            ComboBox1.Items.AddRange(Connections.ToArray)
            If ComboBox1.Items.Count > 0 Then ComboBox1.SelectedIndex = 0
            ' Soon to be loaded and saved to Either reg or ini file (still deciding)
            TextBox1.Text = DefaultInfo.SubNetMask
            TextBox2.Text = DefaultInfo.DefaultPort
            TextBox3.Text = DefaultInfo.UserName
            Logged = False
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Me.Hide()
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            DefaultInfo.IPAddress = Me.ComboBox1.Text
            DefaultInfo.SubNetMask = Me.TextBox1.Text
            DefaultInfo.DefaultPort = Me.TextBox2.Text
            DefaultInfo.UserName = Me.TextBox3.Text
            DefaultInfo.Save()
            Logged = True
            Me.Hide()
        End Sub
    End Class
    Attached Files Attached Files

  4. #4
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Serverless IP Chat [.NET 2005]

    Thanks Sotoasty...

    Works 100%...

    Just I had to call Defaultinfo.Load before I could call for the stored info...

    I'll also be adjusting some of the error returns so that my app gets them and can handle them...

    Thanks Again

    Gremmy...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  5. #5
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Serverless IP Chat [.NET 2005]

    With some time on my hands i've done lots of work on this..

    : settings saved to reg..
    : File Transfers working..

    Still lots to do...

    Enjoy..
    Attached Files Attached Files
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  6. #6
    Join Date
    Jul 2013
    Posts
    1

    Re: Serverless IP Chat [.NET 2005]

    I realise that its been a long time since this thread was started. Sorry.

    I am quite new to VB.net so apologies if I am appearing rather stupid. I was looking for a serverless messenger to run on a private (no internet access) corporate network that I do not have admin access to. We (a group of us) have created a simple .hta file which uses net send but I am looking into a vb.net solution which I found yours and I am trying it out on my home PC before attempting to run on the works network.

    Anyway, I am running it on a Win 7 (64-bit) laptop, VB 2010 express, and when it attempts to save the user info I get the following exception:

    Error saving to registry.

    followed by:

    System.ObjectDisposedException was unhandled
    HResult=-2146232798
    Message=Cannot access a closed registry key.
    Object name: 'HKEY_CURRENT_USER\Software\IPChat'.
    ObjectName=HKEY_CURRENT_USER\Software\IPChat
    Source=mscorlib
    StackTrace:
    at Microsoft.Win32.RegistryKey.EnsureNotDisposed()
    at Microsoft.Win32.RegistryKey.EnsureWriteable()
    at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
    at IP_Chat4.UserInfo.Save() in D:\Work Related\Messenger\UserInfo.vb:line 85
    at IP_Chat4.Login_page.Button1_Click(Object sender, EventArgs e) in D:\Work Related\Messenger\Login_page.vb:line 60
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
    at IP_Chat4.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
    at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    InnerException:


    any ideas??? sorry if it is a simple fix!! or me being stupid!

    Dave

  7. #7
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,961

    Re: Serverless IP Chat [.NET 2005]

    NET SEND has been turned OFF since Windows 95 by default. You have to ENABLE the service on each machine. Talk to the ADMIN.


    Group Policy Setting can enable it for everyone!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center