System.NotSupportedException was unhandled
Message="The given path's format is not supported."
Source="mscorlib"
StackTrace:
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.File.Move(String sourceFileName, String destFileName)
at MHA_Inspection.Automated_Processor.ProcessFiles(Object sender, EventArgs e) in C:\Documents and Settings\ashipp\My Documents\Visual Studio 2005\Projects\MHA Inspection\MHA Inspection\Automated Processor.cs:line 103
at MHA_Inspection.Automated_Processor.btnStart_Click(Object sender, EventArgs e) in C:\Documents and Settings\ashipp\My Documents\Visual Studio 2005\Projects\MHA Inspection\MHA Inspection\Automated Processor.cs:line 41
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.PerformClick()
at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MHA_Inspection.Program.Main() in C:\Documents and Settings\ashipp\My Documents\Visual Studio 2005\Projects\MHA Inspection\MHA Inspection\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
here is the code that I am using to do this:
string
FILE_LOCATION = @"C:\\Documents and Settings\\ashipp\\My Documents\\a1teltest\\";string ARCHIVE_LOCATION = @"C:\\Documents and Settings\\ashipp\\My Documents\\Archive\\a1teltest\\";
string[] Files = Directory.GetFiles(FILE_LOCATION);
foreach (string file in Files)
{
string filename = ARCHIVE_LOCATION, name = "";
i = file.Length - 1;
// do some stuff
while (i >= 0 && file != '/') // find beging of the actual file name
i--;
i++; // get past the '/' that the while just found
while (i < file.Length) // put the file name into the name variable
name += file[i++];
filename += name; // add the name of the file to the end of the archive location
File.Move(name, filename);
}
any help with this problem would be appreciated.