|
98fireblade wrote: catch ex as exception
msgbox("Unable to Delete File!")
end try
this is stupid. There is an exception that typically holds a lot of information, but what the heck, you know best and replace it by a simple sentence providing no clue to the user at all.
Always output Exception.ToString() to either the user or at least a log file, have a look at it, and probably find what is going on.
98fireblade wrote: no the file does not appear to be in use
That is a conjecture, not a fact. Proof it right or wrong.
98fireblade wrote: in one particular folder
if one folder is special, maybe telling us the path, and/or whatever you have done to its security, could help us help you. And do tell us what Operating System you're on, it may provide a clue.
And here for the surprise: if all else fails, add some code to try delete, wait 5 seconds, and try delete again.
|
|
|
|
|
Get off you high horse, we can't all be bloody genius's!
I said the code looks something like this, I supplied the exception which was "Access to the path was denied." which is basically all the information in the catch. I'm also relatively new to the .Net environment, so more help, less attitude would be nice...
When I said the file doesn't appear to be in use, it's not being locked by any user or process, and as stated I can delete it via windows so Security and permissions don't appear to be the issue.
The same piece of code deletes other files and folders on the same remote server without issue.
To answer your OS request, XPSP3 on the machine running the code, and Windows Server 2K3SP2 on the Remote Server.
Just for the record, it's an SMS Compressed file I'm trying to Delete.
|
|
|
|
|
98fireblade wrote: Get off you high horse, we can't all be bloody genius's!I said the code looks something like this
"Something like this" doesn't compile, the machine needs a syntactical correct answer. The devil and the bugs are always in the details, and picking on details needs to become a compulsory habit.
Second, if you move your arse close to a fire, you won't be given a nice advice, but someone will yank your arm and pull you away. That's what just happened.
Back on topic;
- I'd like to see the VB6 code
- I'd like to see console-apps in both languages that attempt to delete the file
- I'd like to see the results of a test on the exact same file.
- I'd like to see the exception. And inner exceptions, if present.
That might sound boring, but it always works
I are Troll
|
|
|
|
|
Are you running this code in a windows service app??
|
|
|
|
|
It's just a normal windows form project if that helps.
|
|
|
|
|
Just another note, I'm upgrading a application I wrote in VB6 to .Net, and the VB6 version deleted this file no problem.
|
|
|
|
|
If it is the (almost) exact same code, you might want to examine the "path" parameter on both your VB6 and VB.Net apps to check for surprises...
|
|
|
|
|
MathmL control for math operations in vb.net project development
Hi ,
Is any one created the MathML based projects in vb.net and how we incorporate in vb.net webbrowser control
Regards,
Selva
modified on Tuesday, August 17, 2010 8:08 AM
|
|
|
|
|
Please edit your question so it is readable, best by removing the tags around your text.
It's time for a new signature.
|
|
|
|
|
|
|
|
Hi,
I have already this TEST code(quick and dirty)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim doc As New iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 10, 10, 10, 10)
Dim fi As New IO.FileInfo(New IO.FileInfo(Application.ExecutablePath).Directory.FullName & "\test.pdf")
Dim sw As iTextSharp.text.pdf.PdfWriter = iTextSharp.text.pdf.PdfWriter.GetInstance(doc, New IO.FileStream(fi.FullName, IO.FileMode.Create))
doc.Open()
Dim pg As New iTextSharp.text.Paragraph("Eerste test")
Dim bf1 As iTextSharp.text.pdf.BaseFont = iTextSharp.text.pdf.BaseFont.CreateFont(System.Environment.GetFolderPath(Environment.SpecialFolder.Fonts) &
"\Arial.ttf", iTextSharp.text.pdf.BaseFont.CP1250, False)
Dim bf2 As iTextSharp.text.pdf.BaseFont = iTextSharp.text.pdf.BaseFont.CreateFont(System.Environment.GetFolderPath(Environment.SpecialFolder.Fonts) &
"\Wingding.ttf", iTextSharp.text.pdf.BaseFont.CP1250, False)
Dim fnt As New iTextSharp.text.Font(bf2)
Dim bc As New iTextSharp.text.BaseColor(Color.Red)
fnt.Color = bc
fnt.Size = 20
Dim prg As New iTextSharp.text.Paragraph("Symbolen", fnt)
Dim i As iTextSharp.text.Image = New iTextSharp.text.Jpeg(New Uri("D:\Data_Jan\Mijn afbeeldingen\000000-78025-200x200.jpg"))
i.Rotation = 45
doc.Add(pg)
doc.Add(prg)
doc.Add(New iTextSharp.text.Jpeg(i))
Dim cb As iTextSharp.text.pdf.PdfContentByte = sw.DirectContent
cb.MoveTo(0, 0)
cb.LineTo(doc.PageSize.Width, doc.PageSize.Height)
cb.SetColorStroke(New iTextSharp.text.BaseColor(Color.Blue))
cb.Stroke()
cb.SetFontAndSize(bf1, 50)
cb.BeginText()
cb.MoveText(200, 100)
cb.ShowText("Text on 200-100")
cb.EndText()
'rotation
'end rotation
doc.Close()
Process.Start(fi.FullName)
Me.Close()
End Sub
At this moment a simple image some text and lines is all I need.
However I can't figer it out how to rotate a single line of text. Rotate an image or the whole page works.
Someone can explain it. almost everything I found is asp or C# + my english it not perfect
Jan
|
|
|
|
|
Im a developer for some years now on vb so i work with visual studio 2008 and 2010 and i was searching for some libraries that allowed me to work with webcams and video to make a face recognition software. my problem is that i have found some stuff but most is for python or C# like OpenCVdotnet
anyone know alternatives to work under vb ?
thanks in advance
|
|
|
|
|
You need to check out DirectShow.Net
http://directshownet.sourceforge.net/[^]
I'm using the library in an application for making Employee Badges. The library allows me to have a real-time video preview window, then click a button and it stores a snapshot in another widow.
The sample programs are pretty good.
Good luck.
|
|
|
|
|
im checking this solution but still it is for C#
also there is something that i dont understand, i cannot find the place where it says where it goes to the webcam. all i see is actions like "cam.Start();" and so on, i press the button and i get an exception because the software does not get the webcam.
|
|
|
|
|
DxSnap is the project that I was using to understand the Video preview and frame capture.
Is that the project you are working with ?
I realized that it is originall written in C#, but I did a translation to VB.net and the Project Admin of the project at SourceForge did not think that a VB version of his demo project was of great value, so I haven't uploaded it.
This is the response I got when I offered my VB.NET translated DxSnap project ...
Quoted from Snarfle(DirectShow.Net Project Admin),
"Hmm. Have you added anything to it? Or is it just a straight conversion to VB? I mean, aren't there programs that will do c# -> VB conversions? "
I'll just keep my VB.NET version to myself.
Actually, I no longer have a direct VB.net conversion of the DxSnap demo program, it has morphed its way into a complete application for capturing images person data, storing it in a database and printing badges.
Best of luck with your project. Maybe Snarfle over at Sourceforge can be of more help.
|
|
|
|
|
i want a version for vb if possible, what i want to do is from live video or from images or recorded video, identify faces, and compare them with a database, if they get recognised, something will happen like "your friend X just passed the street" something like that.
i tried the Luxand FaceSDK and it looks really great, still im still trying to understand where something goes to do this or that, still very new in this. For example i have 2 capture devices, one simply does not work, so the webcam is the second to select, i wanted to add a select menu to all video capture devices available and then do the work.
for now im not getting very serious about the luxand facesdk since what i got is a demo for like 15 days, looks good but i dont know the price, and i belive that it will probably be very expensive.
|
|
|
|
|
i am sorry to hear he was not interested. But i my self am very interested about how to capture images from directshow. with a live video preview. please contact me if you upload the code
|
|
|
|
|
The problem with doing image processing in VB is that VB does not support pointers, so getting at and manipulating image data takes considerably longer than it does in C#, which does support pointers.
Your other option is to do all image manipulation in a library written in another language and wrap that in a VB app.
That's why you don't see any VB apps doing this kind of work...
|
|
|
|
|
Hi all,
I'm new to this forum, I will be very happy if some one can help me with this issue.
I am trying to Encrypt / Decrypt a text as the following
The text is in the format VISA-0 is
041242abcdef6789
The master key is
0123456789abcdef
After encrypting with Triple DES I obtain the following string.
Y9cIS8NUsry7ddNV9cSY7w==
I need to obtain an encrypted string in VISA-0 Format, that is 16 bytes.
I tested this data in a simulator and the outcome should be:
7ea13f5c64c7363b
The same in Base64 is
fqE/XGTHNjs=
The code I am using for encryption is:
private byte[] IV = { 0, 0, 0, 0, 0, 0, 0, 0 };
public override byte[] Encrypt(byte[] plainText, byte[] key)
{
TripleDESCryptoServiceProvider des3 = new TripleDESCryptoServiceProvider();
des3.Mode = CipherMode.CBC;
des3.Padding = PaddingMode.None;
PasswordDeriveBytes passwordDeriveBytes = new PasswordDeriveBytes(Convert.ToBase64String(key), new byte[0]);
des3.Key = passwordDeriveBytes.CryptDeriveKey("TripleDES", "SHA1", 0, this.IV);
des3.IV = this.IV;
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(memoryStream, des3.CreateEncryptor(), CryptoStreamMode.Write);
cryptoStream.Write(plainText, 0, plainText.Length);
cryptoStream.FlushFinalBlock();
return memoryStream.ToArray();
}
Thanks in advance for your help
Maria
|
|
|
|
|
Hi,
I have a form with one textBox and a label, by default the label is disabled which contain some message.
if textBox is disabled, when mouse move to this textbox area, the message is label is shown, if the mouse move out of the textbox area, the label is hide again.
everything works fine if I put these two control in form.
But if I create a groupbox in the form and put these two control to the groupbox, this doesnot work any more, why? how can I use mousemove to capture the control in a container?
Thanks!
|
|
|
|
|
Solve it.
The MouseMove event must be set on the parent control.
and when get the control from mousemove, should use following syntex:
Private Sub GroupBox1_MouseMove()
Dim parent As Control
parent = sender
Dim ctrl As Control
ctrl = parent.GetChildAtPoint(e.Location)
.........
end sub
Thanks!
|
|
|
|
|
Hi, dear all,
I have a form with some controls, some of controls may by disabled based on some options, I wish to show tooltips for disabled controls, so user knows why this control is disabled, after enabled, the tooltip gone.
How can I achieve this? I search a lot from online, but cannot get answer. Find on to handle this case with class, but when unzip the source code, get error.
Thanks!
|
|
|
|
|
|