File LastWriteTime And String Functions
Nov 2, 20091. I copy file xxx.yy from my C: drive to drive F: , which is a USB memory stick, and then execute the following code to get the date from both files:
[Code]...
1. I copy file xxx.yy from my C: drive to drive F: , which is a USB memory stick, and then execute the following code to get the date from both files:
[Code]...
When I look at a file on the server, Windows 7 explorer reports a Date Created date of 5/20/2010 10:49 AM, and a Date Modified date of 5/20/2010 10:50 AM. This is what I expect and what I believe to be true.
However, running my VB.NET code, when I do My.Computer.FileSystem.GetFileInfo(filespec).CreateTime, that value is something completely different: 12/31/1600 6:00:00 PM, and My.Computer.FileSystem.GetFileInfo(filespec).LastWriteTime is set to that same value (12/31/1600 6:00:00 PM).What am I doing wrong? I need to get the values associated with "Date Created" and "Date Modified" as displayed in Windows Explorer.
The solution was simple, I used LastWriteTime instead of CreationTime CreationTime will = time that file was placed on that drive LatWriteTime will = Last time that file was written too, thus the actual original creation time (unless file has been modified of course, which in my case [wmv files] is not going to happen)
View 1 RepliesI have a simple (ASP.NET) web page that lists files of a particular type in a folder and renders them in a ListView.
I've tried to sort them by descending LastWriteTime, that is, in reverse date order. However, although the sort process does change the order of the array, it doesn't sort it correctly. For example, one item with a LastWriteTime of #6/3/2011 12:00:00 is top of the list, but another item with a LastWriteTime of #12/16/2011 12:00:00 is halfway down the list after sorting.
Code:
Dim dirInfo As New DirectoryInfo(Server.MapPath(AppSettings.Item("ContentDir")))
Dim FileArrayList As New ArrayList(dirInfo.GetFiles("*.msg", SearchOption.TopDirectoryOnly))
[Code]....
What I am trying to do is have a class where the functions of the same name are both instance functions and shared functions.
Public Shared Function Get...(byval xx as xx)
and
Public Function Get...
The Public Function uses a Property xx created in the constructor, whereas the Shared Function has the parameters (byval xx as xx).
I have an application written using VB.Net, framework 3.5.In the application I read LastWriteTime and CreationTime values for a file saved in file system. In general,the code works fine except one case when the application is started using Citrix environment. In this case the returned value for bithproperties is January 1, 1601.
View 2 RepliesI'm trying to make code that inserts something into a textbox. However, it appears the insert and remove code isn't working. Here's the
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim a As Integer = TextBox2.SelectionStart
[Code]....
I figured out my more recent issue, which took me 2 days all because my string functions are giving errors in VBScript using MSScriptControl, but any function that returns another datatype value is returning correctly.
[Code]...
I can not fiend any write functions to a text file or to a other file in Windows Direction
I want a simple write function for a button when click button it will write some lines to a file
1) Is it possible to access the Excel mathematical functions without actually opening Excel?
I was thinking of through a DLL WinAPI call or maybe a delegate function or smaller program?
2) Does anyone know of a MS link or area that gives instruction on "how to" use every function of every Windows DLL at all?
Or for all those that Microsoft have chosen to document online at least.
If I have a function that I've written or variables that I use all throughout my application and I don't have to have to copy and paste the code into each form, how can I put those into a file and reference that file and functions within my application?
View 3 RepliesI am using Visual Studio 2005, VB. I have to parse a CPP file and list all the functions that are getting called in that CPP file. Is there any built-in object that can make things easier for me or should i go about searching for () and then finding out the function calls? That is also a bit difficult (I suppose) because there is lot of function chaining also.
View 1 RepliesMining out functions from a CPP file
View 2 RepliesI'm trying to overload several functions. These are first defined in an interface:
Code:
Namespace Scripting
Public Interface IGlobalFunctions
Overloads Function InOutBox(ByVal messageBoxText As String) As DialogResult
Overloads Function InOutBox(ByVal messageBoxText As String, ByVal caption As String) As DialogResult
[Code] .....
It complies and runs.. But I can only use the first version of InOutBox when I try to use the next one I get an error telling me: "Wrong number of arguments or invalid property assignment".
I'm wondering how I can go about creating something like a header file to contain some verbose functions I don't want to have to look at after I get them created. Something like in c++ like..
#include "classfunctions.h" to hide all the nasty stuff you don't want anyone to see.
When I code in PHP I usually keep my functions in a separate file functions.php, I am going to write a small function in VB, is it ok to keep all my functions and subs in the 1 file linke in PHP? will they be available in all my form code?
View 3 RepliesWhat exactly does a System File Watcher do? And what can you do with it?
View 10 RepliesIm not exactly sure how to word this question, but I will give it my best shot.In a new program I am starting I would like to put all the code from a button_click event into a file (many others as well into different files), kind of like a class file in the sence of it being external.lets say I have a button called btnadd and it has some validation code in it Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
[Code]...
The website loads the javascript file with <script src="url.js" type="text/javascript"></script> How would I be able to execute the functions I want?
View 1 RepliesWhile converting types, I have found myself using both VB functions and BCL Convert.To* methods.
E.g.)
Cstr() vs. Convert.ToString()
CInt() vs. Convert.ToInt32()
CDbl() vs. Convert.ToInt64()
etc...
Are there any subtle differences that should be noted?
Is there a way to see exactly what the functions are doing. What i mean is there a way to see the class? I know what it does, i just want to know the code.
For example the function: Membership.FindUsersByName()
using FreeFile and OpenFile functions to find file-locking user name over network
View 12 Repliesi need a vb8 code to open a txt file,search for a string in it & extract string in a excel file.
View 2 RepliesI am attempting to have my program select a file, create DataTables and then perform some other functions. I want to be able to open another file and re-do the same steps.The problem I am having is that I add columns to my Datatables and when I try and to open another file while one is already open I get a message that a column of xyz is already added how do I properly "clear my datatable" or perhaps that isnt even the correct approach? Here is the code I have that Opens a File
HTML
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
[code]....
This was working at one time but after adding to my project I must have placed something in the wrong place inadvertantly or it has soemthing to do with adding columns,?
I'm redoing a program for my company and my boss wanted me to created the entire thing through functions...
For the task I wanted to know is it possible to have functions within functions?
Sort of like in C where we would have nested structures?
Its a FILE I/O, with robot commands, moves and verifications....
So I would find the line in an excel spreadsheet where it moves, the coordinate, put it into an array.
Take the actual results store them into a two dimensional array...etc, etc....
Another function would eventually compare the results with the moves, and within a tolerance.
i need to read binary file and in this file found the string and replace it with other one and save the file afterwords. I found many example to read binary, but to find and replace is for me mistery.
View 3 RepliesThese is the content of my txt file which is saved in D drive in my pc abc,1,2,3..I tried the flowing but it didn't work:[code]I am getting error on this line.. data = line.Split(","c)...it says this line isn't in use anymore or something and that I rather use LineInput but thats asks for filenumber and i don't know what that is. I am sorry but I am a complete beginner. what else can I try? [code]ok that error is gone now but now if I want to add these values to a list box..how can i do that?
View 1 RepliesI Ported this code from a code project article in c# called Nscript
heres the code
Base App
Imports System
Imports System.IO
Imports System.Resources
[code]....
Okay Now I only get two errors (I dont know how to solve them)
Error3Class 'BaseApp' must implement 'Sub OnCompilerError(errors() As CompilerError)' for interface 'IScriptManagerCallback'.
And
Error4Class 'ScriptManager' must implement 'Sub CompileAndExecuteFile(file As String, args() As String, callback As IScriptManagerCallback)' for interface 'IScriptManager'.
But What I would also Like to know (as well as how to fix the errors), is would the code work?
i have a string with the value = "/var/mobile/Media/iTunes_Control/Music/" i need to read the next 13 letter after this string in a text file i am also using a loop to do this multiple times
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Header As String = "/var/mobile/Media/iTunes_Control/Music/"
[Code].....
I've always been slightly stumped as to why the following happens if I write[code]...
View 4 Replies