|
Does anybody know of a way to return just the file name (without the full path) using the OpenFileDialog?
Example:
OpenFileDialog.FileName returns ‘c:\dir1\textfile.txt’
But I want
OpenFIleDialog.?? To return ‘textfile.txt’
Thanks
Brad
|
|
|
|
|
Run the full path trough the Path.GetFileName Method[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
And if u want any more info just...
dim fileInfo as new io.FileInfo(Path)
FileInfo contains alot of extra info.
|
|
|
|
|
And you're telling me this why? Tell the OP, he'll get an email that say you responded to HIM, not me.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
What the hell r u talking about Dave?
|
|
|
|
|
When you reply to a post, CodeProject sends an email to the person who you replied to. Since you replied to me, only I got the message that you posted a reply to one of my posts. I didn't ask a question or wanted any more information, but the person who Originally Posted the question could have used the information y you posted in a reply to me. Reply to the OP and he/she will get the message that you replied to him/her.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ahh true
I see I clicked the wrong one there
|
|
|
|
|
Thanks Dave/Andrew. That worked perfect.
|
|
|
|
|
Curious as to if anybody can point me in the right direction.
I'm wanting to write a application in vb .net that addresses shared folders on windows 2000 server/ and xp machines. I'm wanting to gather currently used files along with the user name of the person that is using this file. it's similar to the server tools "Server Manager" app, but i'm wanting to do other stuff with this information. If anybody could direct me that would be great, maybe Active Directory, WMI, or filesystem functions.
Thanks
Gerry
-- modified at 12:04 Thursday 6th October, 2005
|
|
|
|
|
Search the articles for "Task Manager Extension". There's one project that adds similar functionality to the Task Manager. The problem is that this project is written in C++. So, you'll have to analyze the code and write equivilent code in VB.NET.
There no NO VB/VB.NET examples of doing this anywhere on the 'Net that I have ever found.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm wanting to start programming in c++ anyhow, so should be a good start for me to have an actual project. I have googled around the world a couple times and found nothing also.
Thanks for the help
Gerry
|
|
|
|
|
I have multiple *.config files that I need to write to but (somehow) they have all been set to ‘read only’. Can anybody tell me how, in my code, I can uncheck the read only option before attempting to write to the file?
Thanks
Brad
|
|
|
|
|
Brad Fackrell wrote:
uncheck the read only option before attempting to write to the file?
System.IO.File.SetAttributes("c:\test.txt", IO.FileAttributes.Normal)
|
|
|
|
|
You're looking for the FileInfo[^] class and it's GetAttributes and Set Attributes methods.
It's nice that you put this functionality into the app, but there are also cases when the suer WANTS the config files read only. It would be better if you added an option to turn this functionality on/off.
It would also be better if you figured out why your development copy is ReadOnly in the first place.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave.
I like the idea of being able to turn it on and off.
As for why it was read only, I have no idea what happened but I do know that is should NOT be read only and everybody was yelling at me to ‘just do something’. So, for now, I will just force it back to normal.
Brad
|
|
|
|
|
Hi guys
ArrayList objArrayList=new ArrayList();
objArrayList.Add("a");
we are adding values through Add property but i want to add value same as array so plz tell me how it is possible?
int[] onjAr=new int[]{1,2,3,4,5,6,7,8,9};
can i add value in this format e.g- {1,2,3,4,5,6,7,8,9}
|
|
|
|
|
Asking C# question in Vb.net forum...........Good Idea!
Anyways.....try this
int[] arr={1,2,3,4,5}; <--
it will declare an int array 'arr' having 5 locations......and you can access the values by providing the index
_mubashir
|
|
|
|
|
hi guys!
need a litle help...
i want to retreive only the current time of the system in 12 hour format through sql statement. can any one help me
i tried using "select time=convert(varchar,getdate(),108)"
but it retrieve date in 24 hour format can any one help me..
i only want to retrive time not date..
bi
abhinav
|
|
|
|
|
It would have probably been better to post this in the SQL forum [^]
This is a bit of a hack but it should work:
SELECT RIGHT(CONVERT(VARCHAR,GETDATE(),100),7)
The man who smiles when things go wrong has thought of someone he can blame it on.
If you tell a man there are 300 billion stars in the universe, he'll believe you. But if you tell him a bench has just been painted, he'll have to touch it to be sure.
-- modified at 8:17 Thursday 6th October, 2005
|
|
|
|
|
i think u right ...
by the way thanks a lot it is working ..
bi
abhinav
|
|
|
|
|
I am using a 'Required Field Validator' for my Dropdown list but it doesn't work , if I do not select any thing from the list it still saves the form and I guess that is necause it assmues the first entry in the list as selected always no matter what the first item is.
I also tried using 'Range Validator' to see that the item selected from the dropdown is between 2 & 10... item no 1 in the dropdown is 'Please Select' , but that is not working as well..
does anyone have an idea as to which validator will work to see that the user HAS selected an entry from the dropdown else the form will not save.
Thank you for your precious time invested in answering this query.
Aartee.
...HE is watching Us All!
|
|
|
|
|
use the custom validator -
private void CustomValidator1_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs args)
{
if ( !dropdown.SelectedIndex == 0 )
args.IsValid = false;
}
|
|
|
|
|
Hi guys
is there some body could help me with ISAM problem ? I have one form which is contains a crystal report viewer but when I run this form I always get error message " Could not find Installable ISAM ", Here is I show you my listing code :
Dim dasuminv As OleDb.OleDbDataAdapter
Dim con As New OleDb.OleDbConnection(Koneksi("E:\Data\BTH.mdb"))
Dim dtsuminv As New DataTable()
Function Koneksi(ByVal strdatabase As String) As String
Dim Kalimat As String
Kalimat = "Provider=Microsoft.Jet.OLEDB.4.0;"
Kalimat &= "Datasource = " & strdatabase & ""
Return Kalimat
End Function
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
range1.CustomFormat = "dd-MMMM-yyyy"
range2.CustomFormat = "dd-MMMM-yyyy"
Try
dasuminv = New OleDb.OleDbDataAdapter("select* from suminv", con)
dasuminv.Fill(dtsuminv)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
I don't know how to fixed this matter, could you please to help me ASAP
thank you for your assist
Best regards
I C E
|
|
|
|
|
I am very new to programming and I'm trying to learn VB.NET 2003. Every time I try to create a new project I get an error message that says "Automation server can't create object". What do I need to do to correct this?
Thank You,
Larry J. Williams
|
|
|
|
|
hi there,
this link might help u
Solution
<< >>
-- modified at 20:03 Wednesday 5th October, 2005
|
|
|
|