Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Renaming txt files

Author  Topic 

olay80
Yak Posting Veteran

62 Posts

Posted - 2005-08-01 : 03:28:13
hey guys,
i'm trying to rename through my VB code the name of a txt file saved on the disk? don't know the syntax can anyone help?

thanx,
Oliver

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-08-01 : 04:17:49
File.Move(OriginalFilePathAndName, NewFilePAthAndName)


Go with the flow & have fun! Else fight the flow
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-01 : 04:36:51
and you need to use Microsoft Scripting Runtime reference

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-08-01 : 04:50:13
don't you just need to include System.IO namespace?

Go with the flow & have fun! Else fight the flow
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-01 : 04:54:21
Yes

>>i'm trying to rename through my VB code

But I thought the questioner is trying to do this in VB(and not VB.NET)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-08-01 : 05:09:37
ohhh... i assumed it was .net because it was posted in asp.net forum
but yes from VB you're right of course...

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Girlnet
Yak Posting Veteran

77 Posts

Posted - 2005-08-02 : 13:39:09
Try this article:

[url]http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=208[/url]

It states there is no rename() method but there is a move() method you can use and demonstrates its use in VB.net and C#.

Hope that helps!

PS - Can you even use VB6 in an ASP.NET framework?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-08-02 : 13:42:35
nope... but you can still build asp files so that means using vb script...

Go with the flow & have fun! Else fight the flow
Go to Top of Page

Girlnet
Yak Posting Veteran

77 Posts

Posted - 2005-08-02 : 13:47:19
Ahhhhhh, of course!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-08-02 : 14:41:26
"ohhh... i assumed it was .net because it was posted in asp.net forum"

That'll never work!

Kristen
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-08-03 : 03:32:34
ASSUME - makes an ASS out of U and ME

Though I fail to see why I should be one in this case


steve

Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-03 : 03:45:37
>>ASSUME - makes an ASS out of U and ME

Nice wordings

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -