|
have you looked at gzipstream ? it can do what you want...
|
|
|
|
|
Can this be? Does the getFiles method alter the LastaccessedDate? If so does anyone know a way around this problem. I am developing a program that just cannot have its files data altered in any way.
Any help fro you all would be greatly appreciated.
GT
|
|
|
|
|
GaryT80 wrote: Does the getFiles method alter the LastaccessedDate?
I can't really imagine that it would.
Do you have any observations of it doing this?
---
b { font-weight: normal; }
|
|
|
|
|
I think so. I am having it tested as we speak. But it seems that it is altering the files time stamp.
|
|
|
|
|
I have documented the altering of the LastAccessedDate using the GetFiles method. It does not change every file though. I am finding this to be very odd.
|
|
|
|
|
How do you check if LastAccessedDate has changed?
If you for example check the properties in explorer, it might read the file to get some properties. If it's a media file, for instance, it will read the file to find out things like duration, resolution and bitrate.
---
b { font-weight: normal; }
|
|
|
|
|
I am using a proprietary assembly to extract all metadata and properties from files. I know this is not the culprit in the situation. the code I am using to process a directory is as follows:
Public Function ProcessDirectory(ByVal targetDirectory As String) As String()
Static tcnt As Integer
Static tfiles As String()
Static cnt As Integer = 0
Dim fileEntries As String() = Directory.GetFiles(targetDirectory)
' Process the list of files found in the directory.
Dim fileName As String
For Each fileName In fileEntries
ReDim Preserve tfiles(tcnt)
tfiles(tcnt) = fileName
tcnt = tcnt + 1
Next fileName
Dim subdirectoryEntries As String() = Directory.GetDirectories(targetDirectory)
' Recurse into subdirectories of this directory.
Dim subdirectory As String
For Each subdirectory In subdirectoryEntries
ProcessDirectory(subdirectory)
Next subdirectory
Return tfiles
End Function
Maybe you all can see something that I am not.
GT
|
|
|
|
|
GetFiles shouldn't do it, but right-clicking the file and clicking Properties WILL change the LastAccessed time on files stored on NTFS volumes. It's better to rely on the Modified date and time, not LastAccess.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i have to build blackjack for my project and im having difficulty with the class for the cards. i can get the number to work i am unsure on how the suits work. has anyone built a playing card class at all? many thanks if u could help!
|
|
|
|
|
I wrote classes for card and deck as an example not so long ago. Search for it in the forums.
---
b { font-weight: normal; }
|
|
|
|
|
I was wondering if anyone had a good solution to replacing VB6.FixedLengthStrings(). I need to be able to have a constant length for strings in a function. I tried Dim str As String = Space(#), and that works fine until you set the string to its value (spaces disappear), so its apparent that is not the correct way to fix this problem. Ive been thinking about testing to see the difference between the max length of the value and the max length of the string, but I'm not sure how to put a certain number of spaces to the end of the string as you cannot insert spaces with string.insert(pos, chars). Any thoughts?
Nathan Lindley
|
|
|
|
|
<VBFixedString(15)> Dim sVal as string
Or
CONST MIN_SIZE as int16 = 15
Dim s As String = ""
s = "Hello"
s = s.PadRight(MIN_SIZE, " ")
|
|
|
|
|
Tried the first one but it was to no avail, but the second one is money. Thanks.
Nathan Lindley
|
|
|
|
|
Does anyone know how to make a picturebox control where it is always centered on the form. I have an MDI parent form that is always maximized but depending on the size of the monitor the picture box in the middle isnt always in the middle. I need a way to set this picture box to always be in the center of the form. Thank you.....
|
|
|
|
|
Private Sub Form2_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If Me.WindowState <> FormWindowState.Minimized Then
With PictureBox1
.Left = (Me.ClientRectangle.Width / 2) - (.Width / 2)
.Top = (Me.ClientRectangle.Height / 2) - (.Height / 2)
End With
end if
End Sub
|
|
|
|
|
I do the same thing with a label. I first centered it on the form through the format menu, and then I just anchored it on all four sides. The text is centered both vertically and horizontally in the label. As the font size won't change it doesn't matter that the label gets stretched. I don't know however what happens to the image in a picture box, but otherwise it should work the same way.
Johan
|
|
|
|
|
Hi All
I'd like to know how to cancel a print job (using VB) if the user presses the CANCEL button when the print dialog shows. Any ideas?
thanks in advance
|
|
|
|
|
Do anyone know the code to check to see if a row in a file contains any characters such as commas and quotes. For example:
If row("PartNumber").ToString()contains comma or single quote then
'do something
End If
jds1207
|
|
|
|
|
Dim dsTbl As New Data.DataTable("Test")
Dim dsRow As Data.DataRow = Nothing
dsTbl.Columns.Add(New Data.DataColumn("col1", GetType(String)))
dsTbl.Columns.Add(New Data.DataColumn("col2", GetType(String)))
dsTbl.Columns.Add(New Data.DataColumn("col3", GetType(String)))
For i As Int16 = 0 To 10
dsRow = dsTbl.NewRow
dsRow("col1") = Chr(65 + i)
dsRow("col2") = Chr(66 + i) & ","
dsRow("col3") = Chr(67 + i) & "."
dsTbl.Rows.Add(dsRow)
dsRow = Nothing
Next
For i As Int16 = 0 To dsTbl.Columns.Count - 1
For Each dsRow In dsTbl.Rows
If CStr(dsRow(i)).IndexOf(".") > -1 Then
'code for period
ElseIf CStr(dsRow(i)).IndexOf(",") > -1 Then
'code for comma
Else
'code for neither
End If
Next
Next
|
|
|
|
|
This is way more complicated than what I am trying to do. I just want to find the rows that have characters and insert those rows to a database table.
Here is a function I created to insert into table:
Private Sub ErrorLog(ByVal ErrorDescription As String)
Dim myConnString As String = "Data Source=172.16.20.30,1433;Initial Catalog=RAM-PriceBooks;User ID=ProductUpdate;Password=w00ty;"
Dim myInsertQuery As String = "INSERT INTO Error_Log(Error) VALUES ('" & Trim(ErrorDescription) & "')"
Dim myConnection As New SqlConnection(myConnString)
Dim retvalue As Integer
Dim myCommand2 As New SqlCommand(myInsertQuery, myConnection)
myConnection.Open()
retvalue = myCommand2.ExecuteNonQuery()
myConnection.Close()
Here is some code that I am trying to use to find the characters.
If row("PartNumber").ToString.Contains("'") Then
ErrorLog(row("PartNumber").ToString() & "Not a Valid part number")
ElseIf row("PartNumber").ToString.Contains(",") Then
ErrorLog(row("PartNumber").ToString() & "Not a Valid part number")
Any Ideas?
jds1207
|
|
|
|
|
You could probably make it a little simpler by using the IndexOf method. Something like this:
Dim AnInteger As Integer<br />
AnInteger = YourString.IndexOf(".")<br />
If AnInteger > 0 Then 'something happens here
etc.
Johan
|
|
|
|
|
Hello.
I am currently building a series of ASP.NET pages that serve as reports. All of them offer the possibility of exporting data in Excel format, either by clicking a button or directly setting Response.ContentType to "application/vnd-ms.excel".
To generate the Excel documents I am currently using Office Web Components, version 9. I have generated the necessary wrappers for COM already, added them as reference and is working. However, there is one issue I just can't solve. Some cells in some of the reports need to have the text oriented vertically. I have been looking for some property of the Range object to allow me to do this but so far I didn't found anyhting. It does have HAlignment, VAlignment and such, but nothing that could be used for setting cell orientation.
Does anyone have any suggestions ?
Thanks for attention and hope I didn't posted to the wrong forum.
|
|
|
|
|
How can i execute Command Line Switches of Microsoft Access using Visual Basic 6.0
Please Reply
|
|
|
|
|
All you have to do is add the appropriate switches to the command line that your using to launch Access, usually something like:
C:\Program Files\Microsoft Office\Office\MSACCESS.EXE /repair
You have to specify the full path to the .EXE.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How Can i create any folder ex.c:\hi in setup program(deployment)??
Thank You
|
|
|
|