Issues with VB.Net 2003 v7 (and my skill set) - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Issues with VB.Net 2003 v7 (and my skill set)

horseheadhorsehead Posts: 4Member
Hi all - I have two problems that I hope someone can help me with.

The first to do with the disappearance of the App name on a compiled Windows exe app - I called the project "My project" (in the blue title bar)and on running this gets replaced with "0" (just plain zero) - the icon remains though. Can anyone offer a solution please?

The second problem I have is with the following snippet that I downloaded from PH - the Name keyword is supposed to "rename" the file on disk but I cant get this working - any helpers please:

For i = 1 To lIntcount_files

str = InStr(1, lStrflog(i), ".", vbTextCompare)

Name "c: " & lStrflog(i) As "c: " & Left(lStrflog(i), str - 1) ".dat"

'copy file from source to destination with required extension, destination can be same as source.

Next

Comments

  • dokken2dokken2 Posts: 532Member
    : Hi all - I have two problems that I hope someone can help me with.
    :
    : The first to do with the disappearance of the App name on a compiled Windows exe app - I called the project "My project" (in the blue title bar)and on running this gets replaced with "0" (just plain zero) - the icon remains though. Can anyone offer a solution please?
    :
    : The second problem I have is with the following snippet that I downloaded from PH - the Name keyword is supposed to "rename" the file on disk but I cant get this working - any helpers please:
    :
    : For i = 1 To lIntcount_files
    :
    : str = InStr(1, lStrflog(i), ".", vbTextCompare)
    :
    : Name "c: " & lStrflog(i) As "c: " & Left(lStrflog(i), str - 1) ".dat"
    :
    : 'copy file from source to destination with required extension, destination can be same as source.
    :
    : Next
    :
    :
    You could use the Rename function-

    [code]
    Imports FileSys = Microsoft.VisualBasic.FileSystem

    Public Class Form1
    Inherits System.Windows.Forms.Form

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim str As String
    Dim old1 As String
    Dim new1 As String
    Dim i As Integer

    For i = 1 To lIntcount_files
    str = InStr(1, lStrflog(i), ".", vbTextCompare)

    old1 = "c: " & lStrflog(i)
    new1 = "c: " & Left(lStrflog(i), str - 1) & ".dat"
    FileSys.Rename(old1, new1)
    'copy file from source to destination with required extension, destination can be same as source.
    Next i
    End Sub
    End Class
    [/code]
Sign In or Register to comment.