Application To Application Communication.

Kannan

Member
Joined
Feb 3, 2005
Messages
13
Location
India
Programming Experience
Beginner
This is my situation,
I am having an Application 1 which has a function in it to save and close.
I am starting Application 2 which should communicate with Application 1 and should call the Application 1's save and close function.
The Application 2 should make sure that Application 1 has closed.

Why I am asking this,

1. I am writing an Online Update or Live update application which should close the main application and then download the updates from my online web server and should replace the the updated exe or modules.

2. I am new to VB & VB.NET

I would appreciate if some one reply with a tutorial or source code.

Also a little favor, please give me an idea how to transfer application from web server to the local system with download progress. Seems The Internet Transfer Control is not available in VB.NET

Another little favor, please give me an idea to read a text file "A" which has things like version, date etc text and compare it with text file "B" which has version, date as text.

Finally what I am saying here is, guys & gals, please help me build my own Update application.

The application what I want, should be similar to Norton Antivirus's Live Update feature.

My web server is LINUX has PHP, MySQL

Thanks in advance
 

elloco999

Well-known member
Joined
Dec 21, 2004
Messages
49
Programming Experience
5-10
Hi,

I don't know if it is possible to communicate directly to the application, but when two applications are on different computers you'd use sockets to communicate. I thisnk this should work just fine when both apps are on the same machine...

I can't help you with the download part, since I dont know how to do that...

With the text files I can help you. Here's some code:
VB.NET:
Imports System.IO
 
Dim strAppDir, strFileA, strFileB As String
Dim intFileA, intFileB As Integer
 
Function OpenFiles()
		strAppDir = Application.StartupPath() & "\"
		strFileA = "cur_version.txt"
		strFileB = "new_version.txt"
 
		intFileA = FreeFile()
		FileOpen(intFileA, strAppDir & strFileA, OpenMode.Append, OpenAccess.Default, OpenShare.Shared)
 
		intFileB = FreeFile()
		FileOpen(intFileB, strAppDir & strFileB, OpenMode.Append, OpenAccess.Default, OpenShare.Shared)
End Function
 
Function ReadFromFile(intFile As Integer) As String
'Returns a string containing the entire text in the spcified file
 
Dim strFileText As String
strFileText = ""
 
		Do Until EOF(intDataFile)
			strFileText += LineInput(1)
			strFileText += vbNewLine
		Loop
 
		ReadFromFile = strFileText
End Function
 
Function WriteToFile(intFile As Integer, strLine As String)
'Writes the specified line to the spcified file
 
		WriteLine(intFile, strLine)
End Function
But maybe it's an idea to place the version information in the registry? Makes it harder for other people to mess with it...

I'm interested in such a program myself. Could you perhaps post you code (or email it to me)? Then we can work together on this.

Greets,
El Loco
 

Kannan

Member
Joined
Feb 3, 2005
Messages
13
Location
India
Programming Experience
Beginner
Hey elloco999, thanks,


Regarding Application To Applications,

The application resides in the same machine.

Regarding Download from Web server,

The application will download a text file from our company website through HTTP'

Regarding the Text File,

Thank you very much for replying, I will try the code and post the reply.

Also I will be very happy to post the entire source code as attachment. But will do that after finishing the project.

Hey if you have yahoo or msn or icq or aol, please PM me. I will add you to my list and we can discuss through the messengers.


Still Waiting for the reply for the HTTP download of a file from a LINUX web server and Application To Application communication.
 

elloco999

Well-known member
Joined
Dec 21, 2004
Messages
49
Programming Experience
5-10
Hi Kannan,

I found the .NET Application Updater Component on the internet (actually someone posted the link on another forum). This little component can be used to let your application update itself, using http-dav for the download. In the example they use IIS as their webserver, but I don't see why you can't use a webserver running on linux. The component is written by Microsoft, and even the sourcecode is supplied.

So, anyone looking for auto-update functionality in their application have a look at this link

Greets,
El Loco
 

Kannan

Member
Joined
Feb 3, 2005
Messages
13
Location
India
Programming Experience
Beginner
Hey thanks for the reply elloco, I will check the link and let u know.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
To download a file from a URL, use the System.Net.WebClient class:
Dim objWebclient As New System.Net.WebClient()
Dim objUTF8 As New System.Text.UTF8Encoding()
Dim strIP As String
strIP = objUTF8.GetString(objWebclient.DownloadData _
("http://www.someDomain.com"))
 

Kannan

Member
Joined
Feb 3, 2005
Messages
13
Location
India
Programming Experience
Beginner
Paszt thanks for the reply. I will check that too !
 
Top Bottom