|
What makes you think Vista is changing it, if the issue is on XP ? You can write the code to make the file not read only, if that is the core problem
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian I'll give it a go.
Kris MCP
Kris MCP
|
|
|
|
|
Hello,
I have the following problem:
I have a file path like this: "C:\Program Files\MyProgram\Myfile.ext"
How can I remove the path and only keep the file name, in this case "Myfile"? (I don't want the ".ext" behind it)
Can someone help me please?
Thanks,
Zaegra
|
|
|
|
|
Read up on the Path class.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks, I didn't know it was that simple
Nice work!
|
|
|
|
|
Hi,
I want to remove a value from the default context menu displayed. I dont want to create a new menu as I want to use all the other options in it. Plus I want to add one custom value. Could you tell me how this can be done?
Thanks,
Ahmad
|
|
|
|
|
AFAIK, you'd have to replace the context menu with your own creation, implementing the stuff you would normally find in the menu. I don't believe you can just turn off what you don't want in the default menu.
|
|
|
|
|
i am an amature programer and never used crystal report before.....so would be greatful if anyone would tell me how to use crystal report in vb.Net.
|
|
|
|
|
By a book to get you started, like Crystal Reports for Dummies, depending on the level you wish to start at. The consider what is the best data source for your project.
I tend to populate a Typed DataSet then pass that to crystal for reporting.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Interesting, I always built the report in CR and linked to a stored proc. The in the app I would open to report object, give it the production connection and pass the report to the viewer.
I ended up writing a whole framework around the delivery of CR within an app , I'm sooo glad to have moved to reporting services .
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have an arraylist of FileInfo objects. now based on there LastAccessTime property, i want to sort my arraylist. i tried with implementing IComparable interface, but its throwing exception "Failed to compare two elements in the array"
Please help. Thanks in advance.
-Shraddha
|
|
|
|
|
You're on the right track, try posting your code so we can try to help with it
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
let say, i've a class that implements icomparable
Private Class clsTransfer
Implements IComparable
now i am defining method CompareTo,
Dim fileAccessTime As Date
Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo
Dim objTemp As FileInfo = DirectCast(obj, FileInfo)
Return (Me.fileAccessTime.CompareTo(objTemp.LastAccessTimeUtc))
End Function
Now i am sorting my arraylist
stablefiles.Sort()
i dont know, how to associate my arraylist object with this object of
CompareTo(ByVal obj As Object)
i know i am missing something, but dont know what.....
am implementing compareto method in the same class where my arraylist is defined.
any help would be appreciated....
|
|
|
|
|
Well, you got the right idea, just the wrong interface in your compare class. Thanks for showing us you actually did try to get this to work. You have no idea how rare that is!
The Sort method takes an instance of a class implementing IComparer , not IComparable .
Usually, you just create a small class that implements the lone Compare method defined by the interface:
Public Class FileInfoDateComparer
Implements IComparer
Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer _
Implements System.Collections.IComparer.Compare
' Notice that Compare takes two Objects, not FileInfo objects. Check
' to see if they are both FileInfo objects first.
If TypeOf x Is FileInfo AndAlso TypeOf y Is FileInfo Then
' If they are, cast the Objects back to FileInfo objects
' so we can use them.
Dim op1 As FileInfo = DirectCast(x, FileInfo)
Dim op2 As FileInfo = DirectCast(y, FileInfo)
Return op1.LastAccessTimeUtc.CompareTo(op2.LastAccessTimeUtc)
Else
' Throw an ArgumentException here because both arguements were not FileInfo objects.
End If
End Function
And to call the sort method using this new IComparer implementation:
stableFiles.Sort(New FileInfoDateComparer)
That's it!
|
|
|
|
|
heyyy dave....its exactly what i wanted....
thank you sooo much.......my code is working perfectly now...
thanks a tonn.....keep helping...
Shraddha
|
|
|
|
|
Hey i have a page which is a quiz website..
one question is displayed in the .net page at a time and when i click next button it displays the next question in the same page same place....
I want my page such that if the user does not select ans /if he has selected ans and did not click next button , the next question should automatically be displayed
Thank you
Hepsi
|
|
|
|
|
You can write a timer in javascript that does a postback after 10 seconds.
Please try to ask ASP.NET questions in the ASP.NET forum in future.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
can i know what use of (system.int32)
and dtproduct do i need to declare the "dt" like
is it do like below...
private btncalculate_click(.....)
dim dtproduct as new stocktableadapter
dtProducts.Columns.Add("Total", typeof(System.Int32))
dtProducts.Columns[index].Expression("unitsinstock * unitpricefield")
thanks for the idea
|
|
|
|
|
I'm sorry, but I can't work out what your question is. What on earth is a stocktableadapter ? What do you need to know ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
ops sorry bout that i quite weak.i have create a dataset,inside i create itemtable.inside item table i have 3column name Item_ID,Item_Name,Item_unitprice .
010125 Thumdrive 23.50
i use drag and drop method from datasorce to vb.net.how can i count total amoutn if i choose certain item. like wedoing basic math we use unitprice*quantity=total
quantity i click myself and unitprice is given in datasource.
my datasource name for item is itemdatasource,itemtableadapter,datasetname is ComHdataset.
|
|
|
|
|
OK - in that case, if the user enters the quantity themselves, then you can calculate the total when they enter it, either in javascript, or via a postback.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i just know programming,html,and vb.net code ....javascript and postback i never learn b4...because i just start my collegue life..it's good if u teach me more..this my final assigment
|
|
|
|
|
I don't want to be harsh, but if this is your final assignment, surely you know how to do some research ? You don't need javascript. Postback just means doing it when the server is called, in VB.NET.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
ya..it's ok..thanks for the idea...the assigment only given 4 weeks..quite hard to student like me..so i need some idea or better in full codeing i will very glad...
|
|
|
|
|
Member 4442916 wrote: quite hard to student like me
The idea is that an assignment stretches you, and establishes what mark you deserve
Member 4442916 wrote: better in full codeing
We don't do that. We passed our courses by doing our own work and we encourage others to do the same. IF you get stuck on something specific, we'd love to help.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|