-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Prasanna_kakanoor
Message 8 in Discussion


 
Hi,
 
 Why not u use filesystem object for getting extension of the 
file?
 
Here 
is the sample code
 
strFilesExtn = GetExtension(ByVal "C:\DeskTop\Folder1\Folder2\File.XLS")
 
 
Private Function GetExtension(ByVal strFileName As String)
On Error 
GoTo ErrorHandling
    Dim objFS As 
Scripting.FileSystemObject
    Dim strExtensionName As 
String
    
    Set objFS = New 
Scripting.FileSystemObject
    strExtensionName = 
objFS.GetExtensionName(strFileName)
    GetExtension = 
UCase(strExtensionName)
    Exit 
Function
ErrorHandling:
    Screen.MousePointer = 
vbDefault
    MsgBox Err.Description
End 
Function
 


 Prasanna K L<o:p></o:p>

 Sr. Software 
Engineer<o:p></o:p>

[MCAD(CM) | 
MCSD.NET(Early Achiever)]<o:p></o:p>

<o:p> </o:p>

 ZapApp India Private Limited

  
Level G & 1, Explorer Building, 
  International TechPark, Whitefield Road, 

  Bangalore - 560 066. 
INDIA
  91-80- 5115 6050 extn. 
4061 (phone)
  91-80- 841 1858 
(fax)
  [EMAIL PROTECTED]<o:p></o:p>

<o:p> </o:p>

  
  -----Original Message-----
From: BalajiKrishnan 
  [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 23, 2003 
  11:00 AM
To: BDOTNET
Subject: 
  SubString.......


  
    
      
      New Message on BDOTNET
    
      

  SubString.......


    
      
      
        Reply

        
          
            
            
               
              Reply to Sender   Recommend 
              Message 1 in 
                Discussion 
      
        
          
            
            
              From: BalajiKrishnan 
            
              

                Dear All,
                 
                I want to get the extension of the filename 
                 
                Dim FileExt = "C:\DeskTop\Folder1\Folder2\File.XLS"
                 
                So i used the following code
                
                
Dim intIndex = 
                txtFileName.FileName.IndexOf(".")
                
Dim txtFName = 
                txtFileName.FileName.Substring(intIndex)
                
Response.Write txtFName
                
This prints .XSL,this is what i need.
                
But when 
                
Dim FileExt = 
                "C:\Desk.Top\Folder1\Folder2\File.XLS
                
Note : Desk (dot) Top
                
Then the Result is : .Top\Folder1\Folder2\File.XLS
                
So how can i do 
                it.............
                
Thanks
                
Balaji
View other groups in this 
    category. 



-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to