Correct me if I'm wrong...
It appears that out of the 1800+ classes in the .Net framework, there isn't
a file rename method (discounting the rename function in the vb namespace).
And that the solution is to move the file to the same directory with a
different destination name.
Does that correctly summarize it?
Richard 5 3587
Richard,
I've always done it like that, which is pretty straightforward . However, if
anyone knows a better/different way...
--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF http://www.apress.com/book/bookDisplay.html?bID=105
"Richard L Rosenheim" <ri*****@rlr.co m> wrote in message
news:Ov******** ********@TK2MSF TNGP12.phx.gbl. .. Correct me if I'm wrong...
It appears that out of the 1800+ classes in the .Net framework, there isn't a file rename method (discounting the rename function in the vb namespace). And that the solution is to move the file to the same directory with a different destination name.
Does that correctly summarize it?
Richard
Yes -
Afraid so. You have to move the file for renaming. I have also
faced same prob.
Shankar
10/27/2004 11:36:18 AM
Richard L Rosenheim <ri*****@rlr.co m> wrote in message
<Ov************ **@TK2MSFTNGP12 .phx.gbl> Correct me if I'm wrong...
It appears that out of the 1800+ classes in the .Net framework,
there isn't a file rename method (discounting the rename function in the vb
namespace). And that the solution is to move the file to the same directory
with a different destination name.
Does that correctly summarize it?
Richard
Dear all,
There is Rename function available in Microsoft.Visua lBasic namespace and is
only available to VB.Net and not to other language like C#. seems strange
when i do it. But the best universal and standard solution to rename the file
is to use the File.Move method but in case if you r working on VB.NET, you
got the rename function to rename your files.
Nishith
"Shankara Narayanan" wrote: Yes - Afraid so. You have to move the file for renaming. I have also faced same prob. Shankar 10/27/2004 11:36:18 AM Richard L Rosenheim <ri*****@rlr.co m> wrote in message <Ov************ **@TK2MSFTNGP12 .phx.gbl>
Correct me if I'm wrong...
It appears that out of the 1800+ classes in the .Net framework, there isn't a file rename method (discounting the rename function in the vb namespace). And that the solution is to move the file to the same directory with a different destination name.
Does that correctly summarize it?
Richard
Nishith Pathak <Ni***********@ discussions.mic rosoft.com> wrote: There is Rename function available in Microsoft.Visua lBasic namespace and is only available to VB.Net and not to other language like C#.
No, you can use the Microsoft.Visua lBasic namespace from C#. The Rename
method is a static one in the FileSystem class.
I can't see that it's likely to have a significantly different effect
to using File.Move though.
--
Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
On Wed, 27 Oct 2004 12:24:10 +0530, Shankara Narayanan wrote: Yes - Afraid so. You have to move the file for renaming. I have also faced same prob.
Why is that a problem? It works as intended. When calling the Move method
to the same folder, I believe it just changes the name and does not
actually "move" anything.
--
Chris
dunawayc[AT]sbcglobal_lunch meat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: peter |
last post by:
Hello all,
Recently I've started to refactor my code ...(I'm using python 2.3.4)
I tried to add extra functionality to old functions non-intrusively.
When I used a construct, which involves renaming functions etc... I
came across some recursive problems. (a basic construct can be found
under the section BASIC CODE)
These problems do not...
|
by: Richard L Rosenheim |
last post by:
Correct me if I'm wrong...
It appears that out of the 1800+ classes in the .Net framework, there isn't
a file rename method (discounting the rename function in the vb namespace).
And that the solution is to move the file to the same directory with a
different destination name.
Does that correctly summarize it?
Richard
|
by: MikeY |
last post by:
Hopefully someone can help,
I have a listview box where I display my desired files. I single click on
the desired file to be renamed and I rename it with a new name. My problem
arises when the new name gets displayed through refreshing of my loop and
display function. The problem is that when, if I rename the last file entry,
everything...
|
by: Andy |
last post by:
Hello:
I am using System.Web.Mail.MailMessage. Currently: when I am attaching a
file to the object, I am renaming the file using the FileInfo.Copy method and
attaching the new file to the email:
sNewFileName = fPath + "Front" + fInfo.Extension;
fInfo.CopyTo(sNewFileName, true);
fInfo.Delete();
oMail.Attachments.Add(new...
|
by: cloudx |
last post by:
Hi there, it is driving me crazy. Aftering renaming app.config the following
code I always get null on myApp. It works if I keep the name app.config. Why?
string myApp = ConfigurationSettings.AppSettings;
Thanks!
| |
by: MikeY |
last post by:
Hopefully someone can help,
I have a listview box where I display my desired files. I single click on
the desired file to be renamed and I rename it with a new name. My problem
arises when the new name gets displayed through refreshing of my loop and
display function. The problem is that when, if I rename the last file entry,
everything...
|
by: Jason B |
last post by:
Hello, I have been trying to figure out how to rename my IIS directories and
still have the project be able to run through VS. I have renamed the
directories listed in the csproj.webinfo file and this allowed me to at
least load the project into Visual Studio. However, if I try to run the
asp.net project through VS I get a lenghty error to the...
|
by: bulldog8 |
last post by:
I've read numerous posts and have tried multiple approaches that I
found, but just cannot get a file renamed. I am using VB.Net 2002 ...
Here is what I have tried:
1) Code common to all attempts:
OldName = "c:\albums\061203\email\DSC07272.JPG"
NewName = "c:\albums\061203\email\Lalala.JPG"
|
by: rush81 |
last post by:
i'm trying to create an ssis package for renaming and moving the file. It gives error at the file system task:
Error: An error occurred with the following error message: "Could not find file 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\abc123.xlsabc.xls'.".
the file is abc123.xls. Now why is it pointing to the C drive?
I have...
|
by: NIKHILUNNIKRISHNAN |
last post by:
Experts,
I am getting file not found error while enabling the Renaming option of dotfuscator 4.4 Professional. Can any who has experience in this field help me out ?
with advance thanks,
Nikhil Unnikrishnan.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |