I have a third party program that runs several scheduled batch routines every night. Each type of batch routine creates a folder in the C:\Temp directory. Inside the folders are error reports that are txt files. I am writing a program that will also be run as a scheduled routine, but it will look for the most recent set of folders (tg*, ar*, mdb* are the folder strings) and read the txt files looking for certain strings. If the strings exist it will write the string out to a separate file and that file will contain a listing of all errors for all scheduled batch routines. That file will in turn either be emailed to myself or I will have a shortcut to it on my desktop so I can open it first thing in the morning to find out if any of the routines had errors.
Now that I have thoroughly confused everyone, I need to know how to search for a folder with the above string by date. I have the following code which I thought would do it but I keep getting a SecurityExcepti on error and I don’t know how to get around it. -
Dim dteDate As Date
-
Dim strFldr as String
-
-
'Hard code directory just for example
-
strFldr = c:\temp\ar123456
-
-
'Set date to yesterdays date.
-
dteDate = Today().AddDays(-1)
-
-
Dim dDir As New DirectoryInfo(fldTemp)
-
MsgBox("Last access time was " & dDir.LastAccessTime)
8 1571
Is this the actual code, or did you just type an approximation here? Because it looks to me as though line 5 wouldn't even compile (needs quotes).
And which line produces the error?
Is this the actual code, or did you just type an approximation here? Because it looks to me as though line 5 wouldn't even compile (needs quotes).
And which line produces the error?
In retyping I misssed the quotes. And I get the Security Exception error at line 10, the Dim statement.
My guess is the fldTemp in line 10 should be strFldr.
Beyond that, I think we'll need some input from someone who actually uses a later version than VB6.
In retyping I misssed the quotes. And I get the Security Exception error at line 10, the Dim statement.
This is why we prefer copy and paste where possible. :) We often end up chasing a problem that actually doesn't exist in the code.
This is why we prefer copy and paste where possible. :) We often end up chasing a problem that actually doesn't exist in the code.
Thanks for the tip.
And as to the name of the variable, you were correct, however i still get the same error after fixing that. Im stuck.
Are the files located in a security tight area??...
Can you say do you using VB6 or 5 Or VB.net. I got a specaly code for you. I have made same program but I use for conttrol the OS "C:\WINDOWS\Sys tem32
*VACE*
Thanks for the tip.
And as to the name of the variable, you were correct, however i still get the same error after fixing that. Im stuck.
Can you show us the actual code? So far I think we've fixed two problems that were in it.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Ken Fine |
last post by:
I want my application to maintain a directory tree based on months and
years, e.g.:
2004
January
file
file
file
February
file
|
by: James Owens |
last post by:
I'm a relative newbie, interested in storing the information from several
server directories and subdirectories in XML so that I can present it
selectively using XSL (all files updated today or last MOnday, files from
several drirectories in alphabetical order, things like that).
To represent directories and subidrectories, is it advisable to nest the
same element:
<directory>
<directory>
|
by: JerryP |
last post by:
Hello,
is there a way to launch the property dialogue for a directory from my c#
app ?
I would also like to launch the User Account Properties from Active
Directory Users and Computers, and the properties window for an Object in
Active Directory.
Thanks for any hints.
|
by: trialproduct2004 |
last post by:
Hi all,
I am having C# application which is accepting file name and directory
name.
What i want is to check whether file present in given directory or not.
Directory can have sudirectories in it. So i want searching to be for
innnermost folder also.
|
by: justobservant |
last post by:
When more than one keyword is typed into a search-query, most of the
search-results displayed indicate specified keywords scattered
throughout an entire website of content i.e., this is shown as three
bolded periods '...' in search-result listings.
Additionally, most content is outdated; as many users need up-to-date
content. Hence, filtering-through search-results becomes quite
cumbersome.
The newsgroup listings allow detailed...
| |
by: Aaron |
last post by:
I'm trying to parse a table on a webpage to pull down some data I
need. The page is based off of information entered into a form. when
you submit the data from the form it displays a "Searching..." page
then, refreshes and displays the table I want. I have code that grabs
data from the page using cURL but when I look at the data it contains
the "Searching..." page and not the table that I want. below is the
code i have so far....Thanks...
|
by: Timothy |
last post by:
Hi All,
Please everyone this is my humble request to all of you if you please
have idea about my question then please help me with your master
ideas.
I have requirement that i should either have windows or ASP.NET
Application using VC# - there is start date and end date and there
would be three checkbox - 1Created Date 2 Modified Date 3 Accessed
Date there are the type of file Access specification into our windows
system and i want to...
|
by: Stephenoja |
last post by:
Hello Guys,
I have a challenge here and would really appreciate some help. I have customer bills that are all done in excel with a template and stored in directories by month order. At the end of the month or periodically, I need to query and print a report giving customer name, account number, date of service and cost for a particular service/item for all customers who received such a service/item (at times up to 300 customer bills in...
|
by: jodleren |
last post by:
Hi!
I wonder, which way to do this fastest.
I have a disk, where I need to search for a file or directory.
I do it recursively, meaning that I start from the top dir, then I add
all directories to an array, and by a counter I work my way through
that array.
And, while doing that I add the directory or file (name) to and result
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |