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.
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..
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
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!
I realise that its been a long time since this thread was started. Sorry.
--SNIP--
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
--SNIP--
Hi Dave... Not to worry about the old thread.. Your question is relevant to this thread....
Firstly.... This code was written by me to learn VB.NET skill's and methods.. (I'd do most of it differently if i had to do it today again)... But it works...
So back to your problem....
Registry access has been LOCKED DOWN in WIN 7 .... It's a pain i'm avoiding looking at trying to solve with in my own applications...
The general workaround that i've been using is open 'REGEDIT' .. open HKEY_CURRENT_USER .. right click on SOFTWARE.. Click Permissions, select [PCName]\[UserName] and make sure that Full control is ticked.... ( i sometimes add a permission for [PCname]\Users with full control to fix it)...
There may be another simple fix... But i've been too busy with other more serious issues to check this one out just yet....
Also just dblchk as what user your running the app as ....
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.