473,378 Members | 1,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

delete local files

Looking for help on how to create a page for a client that will find a
specific file on a local drive, upload it to the server, and then delete the
local copy, or allow them to respond and delete tehe local file.
Jul 21 '05 #1
5 1655

"rscott" <rs****@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
Looking for help on how to create a page for a client that will find a
specific file on a local drive, upload it to the server, and then delete the local copy, or allow them to respond and delete tehe local file.


You can try something like this snip to build a list of files in a table.
Then you can bind the table to datagrid or datalist, from there you can
create code to delete, copy etc your files.

Dim strarr as string()

dim dt as New datatable()
Dim myDataColumn1 As DataColumn= new datacolumn("FileName")
myDataColumn1.datatype=System.Type.GetType("System .String")
Dim myDataColumn2 As DataColumn= new datacolumn("LastWriteTime")
myDataColumn2.datatype=System.Type.GetType("System .DateTime")

dt.columns.add(myDatacolumn1)
dt.columns.add(myDatacolumn2)

strarr = Directory.GetFiles(strBindPath,"*???????????cart.x ml") 'get list
of file and puts them in the array variable

'this iterates through the list and puts the file information in a datatable
Dim i as int32
for i = 0 to strArr.getupperbound(0)
dim fi as new fileinfo(strArr(i))
dim drw as datarow
drw = dt.newrow()
drw("FileName") = strArr(i)
drw("LastWriteTime") = fi.lastwritetime
dt.rows.add(drw)
next i
Jul 21 '05 #2
vMike <Mi****************@noYandZ.geZwaYrrenZ.com> wrote:
"rscott" <rs****@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
Looking for help on how to create a page for a client that will find a
specific file on a local drive, upload it to the server, and then delete

the
local copy, or allow them to respond and delete tehe local file.


You can try something like this snip to build a list of files in a table.
Then you can bind the table to datagrid or datalist, from there you can
create code to delete, copy etc your files.

Dim strarr as string()

dim dt as New datatable()
Dim myDataColumn1 As DataColumn= new datacolumn("FileName")
myDataColumn1.datatype=System.Type.GetType("System .String")
Dim myDataColumn2 As DataColumn= new datacolumn("LastWriteTime")
myDataColumn2.datatype=System.Type.GetType("System .DateTime")

dt.columns.add(myDatacolumn1)
dt.columns.add(myDatacolumn2)

strarr = Directory.GetFiles(strBindPath,"*???????????cart.x ml") 'get list
of file and puts them in the array variable


Directory.GetFiles is going to read it from the server though, not the
local drive. I believe the OP wants the client-side files to be read
and deleted. This *may* be possible with JavaScript, but I doubt it, to
be honest.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3
RScott,

There is no way to let you look (using a modern browser) on the client
without an authorized by the user added activeX or Java pluggin. And that is
more and more protected, so when you make it you do not know for how long.

Cor
Jul 21 '05 #4
Jon,

One of the major security issues with the creation of JavaScript (and
VBScript) was that with the language you never could reach the hard disk .
That is why a lot of people started to hate it, however luckily it was a
good decision in my opinion.

Cor
Jul 21 '05 #5

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
vMike <Mi****************@noYandZ.geZwaYrrenZ.com> wrote:
"rscott" <rs****@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
Looking for help on how to create a page for a client that will find a
specific file on a local drive, upload it to the server, and then
delete the
local copy, or allow them to respond and delete tehe local file.


You can try something like this snip to build a list of files in a table. Then you can bind the table to datagrid or datalist, from there you can
create code to delete, copy etc your files.

Dim strarr as string()

dim dt as New datatable()
Dim myDataColumn1 As DataColumn= new datacolumn("FileName")
myDataColumn1.datatype=System.Type.GetType("System .String")
Dim myDataColumn2 As DataColumn= new datacolumn("LastWriteTime")
myDataColumn2.datatype=System.Type.GetType("System .DateTime")

dt.columns.add(myDatacolumn1)
dt.columns.add(myDatacolumn2)

strarr = Directory.GetFiles(strBindPath,"*???????????cart.x ml") 'get list of file and puts them in the array variable


Directory.GetFiles is going to read it from the server though, not the
local drive. I believe the OP wants the client-side files to be read
and deleted. This *may* be possible with JavaScript, but I doubt it, to
be honest.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Oops sorry about that. He could use <input type="file" .... to get the file
and a <input type=submit ... to upload it, but deleting it would be a tough.
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter A. Schott | last post by:
Got a strange scenario going on here in that I could have sworn this worked yesterday. I am issuing binary retrieval calls to an FTP server, writing to a file, close the file, then removing the...
0
by: SeanR | last post by:
I have a function to copare two files. It will first copy the original file form a different server to a local temp path and then compare that version to a version that has been restored form tape....
7
by: Charts | last post by:
I login as administrator of the machine. However running the following code get access denied exception for file inside the directory. The source code: DirectoryInfo target = new...
12
by: Lucas Tam | last post by:
I have a very simple loop: If (Directory.Exists(tempDirectory)) Then Try Dim Files() As String = Directory.GetFiles(tempDirectory) 'Clear out directory For Each Filename As String In Files...
2
by: createdbyx | last post by:
I am trying to make a file sync utillity to sync files between my laptop and my desktop pc. On my desktop machine (xp pro sp2) I have shared my "Visual Studio Projects" folder using windows simple...
5
by: rscott | last post by:
Looking for help on how to create a page for a client that will find a specific file on a local drive, upload it to the server, and then delete the local copy, or allow them to respond and delete...
11
by: comp.lang.php | last post by:
Once again, I thought my class method deleteZip() would do the trick, but it never deletes any .zip* file found in a directory: /** * Delete any latent ZIP files found in this album. This...
0
by: specialrider | last post by:
I have my X: drive mapped to a local directory. In my MSBuild script I call Delete: <Delete Files="%(finalDocBuildFiles.FullPath)" /> The delete never works and i get the following error: ...
0
by: wolfsbane | last post by:
Alright, here it is I am trying to write a win32 app in VB 2005 to clean up user's profiles. everything works correctly except for the Delete("directory", True) statement. I get a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.