|
I have an XML doc that contains some file info (path, date created, etc.) and some media files in a folder with the same properties. Trying to devise some sort of way to compare the two lists and return a list of files that are not already described in the XML doc has been quite a challenge.
First I get the files and their properties from the watched folder:
Dim mediaFiles = From file In fileinfo _
Where file.Extension = ".avi" Or file.Extension = ".mov" _
Or file.Extension = ".mkv" _
Or file.Extension = ".mp4" _
Or file.Extension = ".asf" _
Select file
Then the nodes from the XML doc that describe those files:
Dim showsInXML = From s In doc...<tvshow> _
Select s
After that I compare the two lists, to get the ones that are the same:
Dim mediaOnFileSystemAndInXML = From mf In mediaFiles, sh In showsInXML _
Where mf.FullName = sh.<path>.Value _
Select mf
So far, so good. But after that when I want to 'invert' my selection (get only the files that are on disc, but not described in XML) with the following:
Dim mediaOnFileSystemAndNotInXML = mediaFiles.Except(mediaOnFileSystemAndInXML)
...I get the same ones as in the mediaFiles . As far as I can tell, I'm telling Except to compare the same objects, so what gives?
|
|
|
|
|
hi,
I am working in vb.net 2005
i want to check is current time is lie between two times "t1" and "t2"
i want to check only time values not a complete date or with date.
for example
Current time= "06:21:18 PM"
t1="08:30:15 PM"
t2 ="02:10:05 AM"
WAITING FOR REPLY
|
|
|
|
|
Hi,
create DateTime instances of each of your strings (using DateTime.Parse or better yet TryParse),
then compare them with whatever comparison operator you choose (<, <=, >, ...)
FYI1: when year/month/day are absent their current values are used; that normally does not
interfere with delta calculations or comparisons. If you want to get rid of Y/M/D get
the TimeOfDay property (which returns a TimeSpan).
FYI2: TimeSpan could do this too (without any year/month/day) if you were to use 24-hour notation instead of AM/PM notation; AFAIK TimeSpan.Parse does not understand AM/PM.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
The MP3 player I'm working on needs to detect the volume level at certain points of an MP3 file. I'd like to do this programmatically by looking at the file itself, as opposed to going through the sound card while the song is playing. I want to set it up to start the next song when the volume drops to a certain level. Cross-fading is too arbitrary and clunky.
Can you point me in the direction I need to go to find this information? Thanks in advance.
"Go to, I’ll no more on’t; it hath made me mad." - Hamlet
|
|
|
|
|
You're going to need a library to process the MP3's to do this. I suggest Googling for something like ".net MP3 normalize" to see what the possibilities are. I don't know of any processing libraries myself, since I don't do any work with MP3's.
|
|
|
|
|
Can I insert a link as Linklabel in MsgBox. I want to click in MsgBox to open a site
|
|
|
|
|
No, you can't. You'd have to create your own version of a Message Box to do something like this.
|
|
|
|
|
Thanks then I use form with Linklabel. I check with this code whether .NET Framework version 2.0 is exist.If not exist I want to show MsgBox with link indicate Microsoft site, but I use form with link
Dim key1 As String
key1 = Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey(".NETFramework").OpenSubKey("Policy").OpenSubKey("v2.0").GetValue("50727").ToString()
Dim v20 As Boolean
v20 = False
v20 = (key1 = "50727-50727")
If v20 = False Then
MsgBox("Нямате инсталиран .Net Framework 2.0 на вашия компютър" + Environment.NewLine + "може да го изтеглите от")
End If
|
|
|
|
|
FYI:
Dim key1 As String = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\.NETFramework\Policy\v2.0").GetValue("50727").ToString()
|
|
|
|
|
|
ivo75 wrote: Dim key1 As String
key1 = Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("Microsoft").OpenSubKey(".NETFramework").OpenSubKey("Policy").OpenSubKey("v2.0").GetValue("50727").ToString()
Dim v20 As Boolean
v20 = False
v20 = (key1 = "50727-50727")
If v20 = False Then
Why are you even checking this since the code won't even run without the .NET Framework installed?
|
|
|
|
|
I want user know what application not work
|
|
|
|
|
You don't need to do this check at all! If the .NET Framework is not installed, you're app won't even launch and your code will never get to notify the used of anything.
|
|
|
|
|
I don't think about this, thank You, maybe I check when intall application but I don't know how to make this. Are in InstallShield have something?
|
|
|
|
|
You make the .NET Framework 2.0 a prerequisite to your applications installer. In Visual Studio (not the Express Editions!), if you add a Setup project to your solution, this is done automatically. For other installer projects, you'd have to find out what needs to be done according to the documentation for the installer editor package you use.
You might want to start with this this search[^].
|
|
|
|
|
Thank You I will try to use this
|
|
|
|
|
Is it possible to create something similar like a tabcontrol, but without the page selectors at top... Instead, i want nodes to select each page.
The controls must also be dragable from the designer, and into each page, just like with the normal tabcontrol...
I was told i had to use the Activator, and set each nodes tag to its appropriate panel.
However, there are some problems:
1. I cant do anything if i make a usercontrol, and put it in another form, as i cannot touch the controls within the usercontrol.
2. I cant click on a node in the designer (As you can just click on a tabpage, and it changes to that page)
3. The nodes disappear when i close the designer, and open it again. (How do i save/persist the nodes?)
Mockup:
http://img17.imageshack.us/img17/7831/clipboard01md8.png
Now, im not asking anyone to code this for me, i simply need some directions on how to do it, how to get started
Any ideas?
|
|
|
|
|
vigylant wrote: Is it possible to create something similar like a tabcontrol, but without the page selectors at top...
Wouldn't that just be a stack of Panel controls?
vigylant wrote: Instead, i want nodes to select each page.
And a "node" would be?? I don't remember seeing a "Node" control that I can click on.
vigylant wrote: 1. I cant do anything if i make a usercontrol, and put it in another form, as i cannot touch the controls within the usercontrol.
The child controls of a UserControl are not exposed to the designer unless you provide code that exposes this functionality.
vigylant wrote: 2. I cant click on a node in the designer (As you can just click on a tabpage, and it changes to that page)
Again, I have no idea what you mean by "node".
vigylant wrote: 3. The nodes disappear when i close the designer, and open it again. (How do i save/persist the nodes?)
When you drop a control, like a Button, on a form, code is written by the designer to instantiate that control and set it's properties and wire up events, like Caption, Color, Size, Location, Click event handler, ... in the form's formName.Designer.vb file. You expose this functionality from your UserControl by attributing the proper Properties of your UserControl with the DesignerSerializationVisibility[^] attribute.
|
|
|
|
|
By nodes, i mean the nodes of a treeview... This is the only (i think) control that uses nodes :P
Your idea of a simple stack (just lots of panels) sounds doable... Could be messy though ^^
|
|
|
|
|
You could have just said "TreeView" and it would have made perfect sense.
I didn't look at the link you posted because ImageShack is blocked around here.
|
|
|
|
|
Here are some more links: (Same image all of them)
http://xs136.xs.to/xs136/09074/clipboard01md8980.png
http://bildr.no/image/345164.jpeg
http://s5.tinypic.com/2aihpxf.jpg
The red text says:
"Here, i should be able to drag controllers from the visual studio designer, just like a normal tabcontrol"
|
|
|
|
|
I am trying to filter fields in a table that contain percent (%) and apostrophe (') characters. I kow that to filter an apostrophe you need to add another apostrophe (''). However, when a text contains the percent (%) character in combination with an apostrophe (') character, an exception is thrown. Also, when using the % character in a filter string, it will be function as an "*" (fields starting or ending with). I need the % to be considered as a character whenever the % makes part of a string in the field. How can I address these issues?
To explain my question, say I have a table with 6 rows with the strings below in one of its columns
AnyString
AnyString%
AnyString'
AnyString%'
AnyString%AA
AnyString%AA'
The code below and comments explain the issue.
TheTable.Select("Col1 Like 'AnyString%'") 'RETURNS ALL RECORDS STARTING WITH AnyString (TOTAL OF 6). IT IS EXPECTED, BUT NOT WHAT I NEED. I NEED ONLY ONE ROW: AnyString% <br />
<br />
TheTable.Select("Col1 Like 'AnyString%%'")'RETURNS ALL RECORDS STARTING WITH AnyString (TOTAL OF 6). I NEED ONLY ONE ROW: AnyString% <br />
<br />
TheTable.Select("Col1 Like "AnyString%''") 'RESULTS IN AN ERROR. I NEED TO GET AnyString%'<br />
TheTable.Select("Col1 Like 'AnyString%AA'")'RESULTS IN AN ERROR. I NEED TO GET AnyString%AA
So, I need a way to filter the % character as part of the string and not as a start/end with function.
|
|
|
|
|
Any ideas to this post please?
Let me try this. The example is just an ADO table with 6 rows. I just need to figure out the work around to filter a table that may contain the % character as "part of the string" and not be taken as a wildcard.
dim rows() as datarow = table.select("col1 LIKE 'Filter Me%') 'WHERE % IS PART OF THE STRING AND NOT A WILD CARD. THIS LINE SHOULD RETURN ALL RECORDS EQUAL TO "Filter Me%"
I would also need something like this of course
dim rows() as datarow = table.select("col1 LIKE 'Filter Me%*') '* IS THE WILD CARD AND % IS PART OF THE TEXT. THIS LINE SHOULD RETURN ALL RECORDS STARTING WITH Filter Me%
Thanks,
Mauricio
|
|
|
|
|
|
I want to Delete the Duplicate records from a perticular table except the minimum ID of these Duplicate records.............Using Sql Query
|
|
|
|