|
I know that the below line will delete the file,but it puts it in Recycle Bin.
I want to delete the file completely from the PC.
File.Delete("C:\l\A.txt")
Any suggestion will be helpful.
Thanks in Advance.
modified on Monday, October 19, 2009 9:01 AM
modified 28-Nov-12 7:54am.
|
|
|
|
|
vijay2482 wrote: but it puts it in Recycle Bin
Not on my end
system.io.file.delete()
permently deletes the file
|
|
|
|
|
|
vijay2482 wrote: it puts it in Recycle Bin
I don't think so. IFAIK putting deleted files in the recycle bin is part of Windows Explorer functionality, not of the file system; and File.Delete is a file system operation. You can easily verify. What is your OS?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
The code you posted does exactly what you want. It does not put files in the Recycle Bin.
|
|
|
|
|
I have a messagebox created during run time, I want to set the color of the messagebox to White.
Code:
Private Function AddNonSuffixToSheet(ByVal cd As DataLine) As Boolean
'non suffix cao
Dim response As DialogResult
Dim backcolor As Color = Color.White
Dim title As String = "AVERTISSEMENT - Non Suffixe CAO"
Dim msg As String = ""
msg = msg & "Group-Unit/Assy : " & cd.parent & vbCrLf
msg = msg & "Nombre de composant: " & cd.enfant & vbCrLf
msg = msg & "Non Suffixe CAO" & vbCrLf
msg = msg & "Pour créer et ajouter à la feuille de calcul cliquez sur Oui" & vbCrLf
response = MessageBox.Show(msg, title, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
Return (response = DialogResult.Yes)
End Function
I'm not sure where to use backcolor
Dim backcolor As Color = Color.White
in
MessageBox.Show(msg, title, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
Any suggestions please.
Thanks in Advance.
|
|
|
|
|
|
Thanks.
Will checkout the link.
|
|
|
|
|
Hi,
Iam using Vb.Net 2008. I want to copy a table and its contents from microsoft woord to clipboard.
Any better ideas?
My Codings:
Dim mf As New Microsoft.Office.Interop.Word.Application
mf.Documents.Open("C:\yanyee\myfile.doc")
mf.ActiveDocument.Tables(1).Select()
Clipboard.SetText(??????????)
richtextbox5.paste()
Thanks
|
|
|
|
|
It's not just text, tho. If you're pasting into a rich text box, don't you want to convert to rtf ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Copy to richtextbox is enough at this moment.
Converting to RTF also like to learn.
Thanks
|
|
|
|
|
I think you missed the point; SetText sets text, unformatted text, so it no longer would be a table.
RTF is a document representation that can hold content and formatting, it is the base on which RichTextBox and WordPad work; and other programs understand it too, such as MS Word.
The clipboard can hold many representations; one of them is called "Rich Text Format". However you can't set that using just SetText. I suggest you read up on Clipboard and perform some experiments.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
Tell Word to copy the selection Range to the clipboard using its Copy method.
|
|
|
|
|
hi guys
does anyone know the regular expressions for catching names and values in input?
I'm using this one input.*value=(?:""(?<1>[^""]*)"") but it only gives me the values.
I need to get the values and names for any kind of HTML components.
thank you
|
|
|
|
|
Google for "Expresso". Its a great little utility you can use to build Regular Expressions and test with with any sample data you want. Doing RegEx without it is just silly.
We really can't tell you what the expression is without knowing the details of what is legal to make a valid name/value pair.
|
|
|
|
|
thank you so much Dave Kreskowiak. The Expresso program helps me alot.
|
|
|
|
|
Hi All,
I created one application in VB.net from Visual studio 2005. There is a button on my form1 which on click event opens another form2.
Now When I form2 is open, I cannot access the form1, i mean i want all the forms to be independent i.e. all the forms to be accessible to the user.
Can anyone let me know how to do this?
|
|
|
|
|
You should buy a basic book on Winforms. You make the second form a member and call Show instead of ShowDialog, to show a modeless form.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Use
form2.Show()
instead of
form2.ShowDialog()
Hope this helps.
Shameel
|
|
|
|
|
I can see how that expands on what I said.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yeah, he used the pretty PRE tags around his example.
|
|
|
|
|
|
Dave Kreskowiak wrote: he used the pretty PRE tags
much appreciated.
wish everyone would use them.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
Hi all,
I'm working on an application that create a file in a specified directory.
Code:
I want to create this file in a folder that was selected by the user, through FolderDialogBox.
The path is stored in TextBox1.
I want to do something like the below:
When I do the above I get the below error message:
A reference to a non-shared member requires an object reference.
Somebody help to find a solution.
Thanks in Advance.
modified 28-Nov-12 7:55am.
|
|
|
|
|
vijay2482 wrote: Somebody help to find a solution.
First you need to read a basic programming book. Even if you removed the const, this would compile but not work. You need to remove the const AND set the value when the value of the textbox is set. You also need to give your variables real names, unless you're trying to write illegible code.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|