Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Ok guys I am working on a simple program

 

a command button that will find a file and rename it.

is there a simple way..

 

I was thinking of using the shell command but does not quite work the way I wanted to.

 

can someone please give me a quick code as I am sure this is very simple

 

thanks guys

  • Moderators
Posted

You mentioned Shell command, do you want to start an external app? If so, try this...

 

   Dim WithEvents myP As Process

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       myP = Process.Start("c:\winnt\system32\notepad.exe")
       myP.EnableRaisingEvents = True
   End Sub

   Private Sub myP_Exited(ByVal sender As Object, ByVal e As System.EventArgs) Handles myP.Exited
       MessageBox.Show("Application Exited")
   End Sub

 

You can rename a file by making a copy then delete the original.

 

Dim f As System.IO.File
f.Copy("c:\Test.txt", "c:\testing.txt")
f.Delete("c:\Test.txt")

Visit...Bassic Software
Posted

oh.. so how does one create..

 

oh.. so how does one create.. an application in .net and run it on other machines.. if they do not have that installed? might as well go vb6

Posted

C++ uses a runtime too just not very often

 

In 2008 Microsoft won't support VS6 casuing .Net to be the only choice anyway. The next version of Windows will probably have the .Net framework included.

.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Posted
Actually I was thinking of msvcp50.dll, msvcp60.dll, msvcp70.dll. They all contain the phrase: "Microsoft ® C++ Runtime Library"
.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Posted
You mentioned Shell command, do you want to start an external app? If so, try this...

 

   Dim WithEvents myP As Process

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       myP = Process.Start("c:\winnt\system32\notepad.exe")
       myP.EnableRaisingEvents = True
   End Sub

   Private Sub myP_Exited(ByVal sender As Object, ByVal e As System.EventArgs) Handles myP.Exited
       MessageBox.Show("Application Exited")
   End Sub

 

You can rename a file by making a copy then delete the original.

 

Dim f As System.IO.File
f.Copy("c:\Test.txt", "c:\testing.txt")
f.Delete("c:\Test.txt")

 

Great was looking how to do this, only in c#. Pretty straightforward tho.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...