473,386 Members | 2,050 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,386 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 1657

"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...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
jinu1996
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...

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.