|
That trick isn't going to work. One of the first things the constructor for the DirectoryInfo object does, in .NET 2.0, is convert the path you give it to a normalized form. That means converting it to it's Full Path specification. The limit on that returned (internally used) path is 260 characters.
No matter what, it's NEVER a good idea to use paths that long, for any reason. Not because of compatibility issues with the .NET Framework, but because of the same issues with other software, like BackupExec. Keep your paths under 260 characters if you want to avoid future problems.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I understand the reasons for keeping the paths to a decent lenth but I currently have a machine that has paths that go much deeper than 260 characters and the shortpath trick used to work fine with the drirectoryinfo object in .Net 1.x. Is there no way around this in .Net 2.0?
Thanks.
|
|
|
|
|
Nope. Like I said, the first thing the DirectoryInfo object does is normalize the path to its full length, so you can't use it for what you're doing.
You can try to use the the static methods (Directory class, not DirectoryInfo) and try to use the return path from GetShortPathName as the directory to search. But, I'm seeing code in there that looks like it might also normalize the path too, though it might not.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Hi everybody,
I am creating a small website, in which i want to use windows media player's video file. I am providing a navigation button to go through the website. But i want to keep disable that button untill the video is finished. Once the video is completed then button shuold be enable.
If any one can help me for this problem, please do my favour.
Thank you.
Best Regards,
Ahmad Tasnim Siddiqui
Mail id: tasnim5@yahoo.com
Tasnim
|
|
|
|
|
You'll have to ask this in the ASP.NET or Web Development Forums. THis will require client-side JavaScript. You can't do it using VB.NET on the server-side.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave,
Thank you for your valuable suggession.
Take Care,
Regards,
Ahmad
|
|
|
|
|
hi,
i have added a button in windows datagrid. it works fine when i load the grid first time and click the button. but if i reload the datagrid again on some event and i click the button, its click handler is called twice.
if i again load the grid then the click handler is called thrice.
how can i correct this ?
i want to call the button's click handler only once like in normal application.
Regards,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
Somewhere in your code you used AddHandler to wire up the Click events of the button. Before you reload the data into the grid, use RemoveHandler to unwire those buttons before you destroy them.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
or you can use module level boolean variable to check wether the button is already clicked
|
|
|
|
|
I am using visual studio .net 2002.
I have created windows application using vb.net.Created one form and
I am opening one crystal report using that form.I have used CrystalReportViewer.
When I was design application, it was asking for Crystal report Registration.
I was allways cancelling this and was able to work on application/crystal report.
Note : I don't have internet connection.
One day I have entered following ,in the registration window.
Registration number : 8013180283
Key code : A5S50-81C0000-5X00027.
when I wanted to run that an error occured.
An unhandled exception of type
'CrystalDecisions.CrystalReports.Engine.OutOfLicenceException' occured
in CrystalDecisions.CrystalReports.engine.dll
version : 9.1.3300.0
Next day when I opened the application,it doesn't opened and there is continous
error "invalid KeyCode"
pls help me out ,what may be the reason.
s.Radhakrishna
|
|
|
|
|
|
hi ..
can anyone give me msgrNL32.dll or msgr3NL.dll..its the one used to check spelling in word for dutch language..
thanx in advance..
|
|
|
|
|
BINO VARGHESE wrote: hi ..
can anyone give me msgrNL32.dll or msgr3NL.dll..its the one used to check spelling in word for dutch language..
thanx in advance..
Clickety[^]
|
|
|
|
|
thank you very much
|
|
|
|
|
the DLL in that website is corrupted my dear friend...so can u plz send me someother link..
awaiting reply..
|
|
|
|
|
BINO VARGHESE wrote: the DLL in that website is corrupted my dear friend...so can u plz send me someother link..
awaiting reply..
Well, I just googled for the file name and found some sites...
|
|
|
|
|
can u send me if u get any free sites for the DDL...me too searched but itz all paid sites
|
|
|
|
|
|
thanx dude vl try using it....
|
|
|
|
|
I have an array of objects. Each object refers to an mp3 file as follows:
mp3file.Title
mp3file.Artst
mp3file.Album
mp3file.TrackNumber
My question is, how can I sort the array by a specific item of the object, eg. Sorted by Artist, sorted by Album etc.
Thnaks
|
|
|
|
|
Make a custom comparer for your class, and use that in a call to Array.Sort.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Thanks for the quick reply.
You say, 'Make a custom comparer for the class'. I'm fairly new to VB.net and don't quite understand what you mean. Please could you explain a little more.
Thanks again
|
|
|
|
|
Something like this. Say you want to sort by Artist name.
Make a function:
Function CompareArtist(ByVal Artist1 As String, ByVal Artist2 As String) As Boolean
IF (Artist1>Artist2) Then
Return True
Else
Return False
End IF
End Function
Then when you do your sort, have something like this:
If CompareArtist(mp3file(1).Artist,mp3file(2).Artist) Then
//Do you sorting here depending on the result of the compareartist function.
End If
You could make a seperate comparison function for each member of the object, or just 1 or 2 depending on the type's of the object's members (if they are all strings for example). I hope that makes some sense.
David
|
|
|
|
|
Thanks very much, this is the sort of thing I was after.
I guess you cant use array.sort on an array of objects. I though there was probably some syntax you could add into array.sort to specify which 'column' you wanted to sort by.
Anyway, the code you have given me David looks fine. Thanks
|
|
|
|