R
rn5a
An inquisitive question......
A ListBox lists all the directories & files residing in a directory on
the server. Assume that the ListBox lists 2 directories & 4 files. Also
assume that one of the directories is named 'mydir' (without the
quotes). Note that the all the letters in the directory name are in
lowercase.
To rename any directory/file, one can use the Move method of the
Directory/File class respectively but ASP.NET doesn't allow to JUST
change the case of a directory/file name. For e.g. if I want to change
the name of the directory from 'mydir' to 'MYDIR', ASP.NET generates
the following error:
Source and destination path must be different.
when the Move method of the Directory class is invoked. This, I
believe, is obvious because the Move method is primarily meant for
moving a directory/file from one location to another location.
Hasn't Microsoft included any method in the ASP.NET Framework to
exclusively rename a directory/file. Isn't there any way by which I can
change the directory name from 'mydir' to 'MYDIR'?
Though strictly speaking, changing the directory name from 'mydir' to
'MYDIR' doesn't amount to renaming; it's merely changing the case of
the directory name.
Note that if you navigate to 'mydir' from 'My Computer', then Windows
does allow users to change the directory name from 'mydir' to 'MYDIR'
i.e. Windows allows users to just change the case of a directory/file
name without generating any error.
A ListBox lists all the directories & files residing in a directory on
the server. Assume that the ListBox lists 2 directories & 4 files. Also
assume that one of the directories is named 'mydir' (without the
quotes). Note that the all the letters in the directory name are in
lowercase.
To rename any directory/file, one can use the Move method of the
Directory/File class respectively but ASP.NET doesn't allow to JUST
change the case of a directory/file name. For e.g. if I want to change
the name of the directory from 'mydir' to 'MYDIR', ASP.NET generates
the following error:
Source and destination path must be different.
when the Move method of the Directory class is invoked. This, I
believe, is obvious because the Move method is primarily meant for
moving a directory/file from one location to another location.
Hasn't Microsoft included any method in the ASP.NET Framework to
exclusively rename a directory/file. Isn't there any way by which I can
change the directory name from 'mydir' to 'MYDIR'?
Though strictly speaking, changing the directory name from 'mydir' to
'MYDIR' doesn't amount to renaming; it's merely changing the case of
the directory name.
Note that if you navigate to 'mydir' from 'My Computer', then Windows
does allow users to change the directory name from 'mydir' to 'MYDIR'
i.e. Windows allows users to just change the case of a directory/file
name without generating any error.