|
You need to use a Typed DataSet.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I have need to determine which user created a particular file on the server, therefore I was wondering if anyone knew of away of reading the Details properties of a file. ie if you right click a file and select Properties there is a tab called Details. One of the properties here is called 'Owner'
I have already tried the Microsoft Developer Support OLE File Property Reader COM Object but not have any luck there.
Any help gratefully received.
Thanks
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
This article[^] may help you.
txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
If anyone is interested, I found this code snippet that returns the information I need, in particular the file owner :
Sub Main()
Dim arrHeaders(35)
Dim shell As New Shell32.Shell
Dim objFolder As Shell32.Folder
objFolder = shell.NameSpace("\\PDMHH01\RMSage\GroupRM\SageSP")
For i = 0 To 34
arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
Next
For Each strFileName In objFolder.Items
For i = 0 To 34
Console.WriteLine(i & vbTab & arrHeaders(i) & ": " & bjFolder.GetDetailsOf(strFileName, i))
Next
Next
Console.ReadKey()
End Sub
Point to note, you do need to reference in the \Windows\System32 folder
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hi there,
I'm pretty new to this but what I'm after is a method of getting the Last modified date from a file, then renaming the file to that data/time stamp.. If there are any duplicates then appending _1, _2 etc to them....
I've been looking for the correct file.getX and have found the
file.getattributes, for hidden /readonly etc.. but can't find the correct one for file Properties, specifically modified time.
Can anyone help...
Thanks
|
|
|
|
|
You're looking for the FileInfo[^] class, which has a LastWriteTime property.
|
|
|
|
|
Smashing... thanks for that....
|
|
|
|
|
nhsal69 wrote: Smashing...
Not often I hear someone from Scotland using that!
|
|
|
|
|
What can I say, I'm diverse :P
|
|
|
|
|
Just one more thing...
fsi.lastaccesstime, fsi.creationtime
all appear to generate day moth year in teh form "23 March 2010" but I need it to include the hours mins and sec.. any ideas??
the example I'm using is:
<br />
Imports System.IO<br />
<br />
Public Class Form1<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
' Loop through all the immediate subdirectories of C.<br />
For Each entry As String In Directory.GetDirectories("C:\temp\test")<br />
DisplayFileSystemInfoAttributes(New DirectoryInfo(entry))<br />
Next<br />
<br />
' Loop through all the files in C.<br />
For Each entry As String In Directory.GetFiles("C:\temp\test")<br />
DisplayFileSystemInfoAttributes(New FileInfo(entry))<br />
Next<br />
End Sub<br />
<br />
Sub DisplayFileSystemInfoAttributes(ByVal fsi As IO.FileSystemInfo)<br />
' Assume that this entry is a file.<br />
Dim entryType As String = "File"<br />
<br />
' Determine if this entry is really a directory.<br />
If (fsi.Attributes And FileAttributes.Directory) = FileAttributes.Directory Then<br />
entryType = "Directory"<br />
End If<br />
<br />
' Show this entry's type, name, and creation date.<br />
Console.WriteLine("{0} entry {1} was created on {2:D}", _<br />
entryType, fsi.FullName, fsi.LastAccessTime)<br />
<br />
End Sub<br />
<br />
<br />
End Class<br />
Any thoughts??
Thanks
|
|
|
|
|
It DOES return the date and time, but, you have to go a little deeper that just LastWriteTime. LastWriteTime returns just a Date object, but all Date objects also hold a time. You just have to tell it to return that information. Hit "." after fsi.LastAccessTime and you'll see all the properties and methods exposed by the Date object it returns, including Hour, Minute, Second, ToShortTimeString, ToLongTimeString, ToString (where you can provide a custom format string to return the date/time in any format you want)...
|
|
|
|
|
nhsal69 wrote: Console.WriteLine("{0} entry {1} was created on {2: D}", _
entryType, fsi.FullName, fsi.LastAccessTime)
If you just leave out the format symbol on your date, using {2} instead of {2: D} then you will get the time component as well.
|
|
|
|
|
|
nhsal69 wrote: I'm diverse
which is good.
Now reading a book on VB.NET would give you more depth on .NET programming.
|
|
|
|
|
Andy Murray does.
|
|
|
|
|
Luc Pattyn wrote: Andy Murray does.
Yeah, he is renowned for his ability to code while serving.. all that shouting between points is critic of his SQL and systemfileinfo coding
I need to listen more closely next game to get hints and tips...
|
|
|
|
|
I now have a piece of code which scans a folder and reset the file names to the exact date and time the file was created..
The only problem is I need the modified time (these are all photos, and the modified time is the time the photo was taken) ever other time stamp has been changed when the files were copied from camera to phone etc.
So FileInfo gives you:
CreationTime
LastAccessTime
LastWriteTime
as well as various other bits and bobs, but no Modified time.
I can see it in the jpg files properties, so it must be getabe??
Any ideas??
|
|
|
|
|
LastWriteTime IS the "Last Modified Time" in NTFS.
If you're talking about getting a time out of the metadata in the picture file itself, then these methods will do nothing for you. You need to get the properties out of the JPG. Google for "jpeg metadata vb.net[^]".
|
|
|
|
|
Dear All,
I'm using a HCL Thin Client for run my vb application. I'm getting data through com port which is in thin client. The problem is when I run the application on my thin client it's saying that "The COM port is not ready or busy" (I checked the com port with Hyper Terminal, it's working fine and receiving data). Pls comment on this how to get data from com port on thin client.
|
|
|
|
|
Can we see the code you are using to intregate the COM port?
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Actualy I don't have the source code. It's developed by third party. But according to them the software is working fine in a PC environment( VB6 also installed on that PC)
|
|
|
|
|
Is the application code being run on the thin client or is it being run on the server and the interface just shows up on the thin client?
In the first option, you've got a problem. Since only one copy of the application copy have the serial port at any one time (depending on the server of course!) the first application to get it may work perfectly, and all others will fail.
The second option depends on the configuration of the think client. I also love the little statement on their website that says "the look and feel of working on a Windows environment". That really doesn't instill confidence in which and what type of apps can work.
Your best source of information for this problem is going to be HCL.
|
|
|
|
|
This application is running on Thin Client and sending the information to the server which is located the database. And further I wanna know is that possibility to install VB6 on Thin Client.
|
|
|
|
|
Again, your best source of information is the manufacturer of the machine.
I have no experience with these machines and I seriously doubt anyone else who answers questions around here on a regular basis does either.
|
|
|
|
|
Hi I need help on a function where once the button is clicked, it will then send a signal to the sensor so that when there is an object in the way then the program will read it and count each time there is an object. I have managed to communicate with the parallel port. However I am stuck on creating a loop.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Do
Out(PortAddress, Value)
Value = 8 'The Port it is written to
TextBox2.Text = CStr(Inp(PortAddress))'Read back and display the result.
TextBox1.Text = 1
Loop Until TextBox1.Text = 10
End Sub
|
|
|
|