2 questions(plz come)

frix199

Member
Joined
Jul 18, 2005
Messages
19
Programming Experience
1-3
hello there!

i hav 2 questions:eek:

let's take it tidy....

-----------------
1st
-----------------
can i somehow make an application copy herself into a dir?
like:
app path = */myap.exe
with some lines of code copy myap.exe into c:/hello/

-----------------
2nd
-----------------
i hav 2 appl., one client and one server
how can i somehow send a text or a pic from the server to the client and vice versa????



really tnx 4 ur help
 
Hey frix..
for your 1st question..
you can do this way too incase you need this in your program for some other reason...
system.Io.file.copy..
try the stuff inside the system.io.file namespace :)
 
Ok then, i will put the function below and wait untill someone else complain that it doesn't work :)
means, this is a function that will create Shotrcut in Start Menu:
VB.NET:
VB.NET:
 [COLOR=#0000ff]Public [/COLOR][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][SIZE=2] CreateShortCutOnDesktop([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] TargetFolder [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] TargetFile [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2]) [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Boolean
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] startUp [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2] = TargetFolder
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] shortCut [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] IWshRuntimeLibrary.IWshShortcut
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] WshShell [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] WshShellClass
shortCut = WshShell.CreateShortcut(startUp & "MyNewShortcut.lnk")
[/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] shortCut
.TargetPath = TargetFile
.WindowStyle = 1
.Description = "Test"
.WorkingDirectory = startUp
.IconLocation = Application.StartupPath & "/sound_box.ico" [COLOR=darkgreen]'be sure that .ico file exists[/COLOR]
.Save()
[/SIZE][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Return [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] ex [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Exception
MessageBox.Show("Error:" & ControlChars.NewLine & ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
[/SIZE][SIZE=2][COLOR=#0000ff]Return [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]False
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Function [/COLOR][/SIZE]

Regards ;)
 
Back
Top