|
TT(n) wrote:
Wrong,
the best way to get rid of temporary internet files is, to use a sendkeys code:
SENDKEYS??? Are you crazy? SendKeys is DEFINATELY NOT the best way to do it. The method that you're using is problematic at best. One, your relying on the user interface of another application, which can change over time and versions. Two, your using SENDKEYS, which will post keystrokes to the window that has the input focus, which, in a multitasking environment, can change AT ANY TIME. Even between the time when you activate the application your going to send the keys to and the time that you actually call SENDKEYS. This can AND DOES happen even when you put the SendKeys statement directly after your activate.
TT(n) wrote:
Cookies are done similarly, but you have to work around the index.dat file.
If you have to make special exceptions for a file, it makes SendKeys far more difficult to use that it should be.
No... the BEST WAY to do it is using the same API functions that IE uses, using the same methods. And you don't have to make any special exceptions for anything.
EDIT:
I should have put in an example of the problem I talking about. Your AppActiveate statement executes, right then you have an Instant Messager message come in, I don't care what product its running on. When that message comes in, some IM apps will bring the chat window into the foreground and snag the focus, others will let you control this functionality. Now, your SendKeys statement runs. Where do you think your keystrokes are going to go? Hint: Not where your AppActivate statement says!
If your going to tell me, or ANYONE else here, they're "wrong", you better have a mountain of evidence to back it up, not just your opinion. If not, you only have an ALTERNATIVE method to what was suggested as a solution.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The mountain of evidence, is that I have used to code on 15 PC's with absolutely no problem. I have them automated to clear stuff out after IE is shut down. Since the windows IE advanced property for this does not always work, so go figure.
Some of mine are set on timers, and they always continue focus, though anything is possible, so you could modify the code to cancel out some interference. With your method,... I have seen it not work many times.
Probably due to hacks, etc.
I understand you are offended for being told wrong by a rookie.
But to go on, like there is no way to just delete them, as a user would is incorrect, or INCOMPLETE, is the word i was looking for.
You, can do so more reliably from the;P mountain of evidence that I have seen.
|
|
|
|
|
This code works for someone looking for a simple answer, as asked.
Private Sub Command1_Click()
Dim ExpId As Integer
On Error Resume Next
ExpId = Shell("Explorer c:\Documents and Settings\Users Folder\Local Settings\Temporary Internet Files", vbMaximizedFocus)
AppActivate (ExpId)
SendKeys ("%(e+a){delete}%(f+c), 1")
End Sub
An automated version, could wait until processes are idle or shutdown etc.
The workaround for the index file, in the cookie folder, isn't much for complicated but there are few ways.
|
|
|
|
|
TT(n) wrote:
With your method,... I have seen it not work many times.
Probably due to hacks, etc.
I've never had a problem with it. But I have with other applications stealing focus, especially in Instant Messaging environments and login scripts running concurrent utilities for various tasks. In an environment with 15,000 users, SendKey's flaws shine VERY brightly...
It was just much smaller code to use the right API's correctly, than it was to counteract the flaws using SendKeys...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Backpedal, you said it is required to do it your way, and that you can't just go in and delete the files/folders.
If the API's were smaller, why not post it with a few lines?
API's are flawed too, it is big business to get cookies etc on your machine.
You have a point, sendkeys can be funky but within the correct parameters works just fine. Besides the person asking the question sounds pretty green.
'Here is another approach that works better, than a simple sendkeys.
'Set your timer to 500, or 1000 and set txtTime.text = 5.
Private Sub Command1_Click()
txtTime.Text = 0
End Sub
Private Sub Timer1_Timer()
Dim time As Integer
On Error Resume Next
time = txtTime.Text
txtTime.Text = txtTime.Text + 1
End Sub
Private Sub txtTime_Change()
Dim ProcessId As Integer
On Error Resume Next
If txtTime.Text = 1 Then
ProcessId = Shell("Explorer c:\Documents and Settings\DivinePrime.HAL\Local Settings\Temporary Internet Files", vbMaximizedFocus)
AppActivate ProcessId
End If
If txtTime.Text = 2 Then
AppActivate ProcessId
SendKeys "%(e+a){delete}"
End If
If txtTime.Text = 3 Then
SendKeys "%(y)"
End If
If txtTime.Text = 4 Then
AppActivate ProcessId
SendKeys "%(f+c)"
End If
End Sub
|
|
|
|
|
TT(n) wrote:
If the API's were smaller, why not post it with a few lines?
Because I'm not in the habit of just giving solutions away to everyone. You don't learn anything by being handed every answer. He can attempt to do the research and construct the code himself and then ask questions on what he's doing wrong. But to just be handed the complete answer... I haven't done that yet and am not about to start. Besides, we're here to HELP people with problems, not solve them for everyone.
And I not going to get into a coding contest with you either. I've got better thing to do with my time than to prove myself to you.
TT(n) wrote:
API's are flawed too, it is big business to get cookies etc on your machine.
I haven't had any problem with these. And besides, that what patches and service packs are for. Actually, cookies are just little text files with data in them. No code! Getting you to install the spyware is much bigger business.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Oh you poor thing, you install service packs as directed. lol
You need not defend them, everyone knows how much they stink, except you.
Data is very important regurding how, and when the spyware will go in.
For instance, a common spyware is actually on a comcast cd(broadband) I recieved. It installs it's look-a-like browser, with a some isearch that doesn't even work. The ironic part, is that comcast advertises that they can eliminate certain spyware's, INCLUDING the one on the CD, for a fee ofcour$e.
That's like starting up a windshield repair service, and then at night while no one is looking, go around bashing windows.
Ok now that it's over.
You stand corrected.
|
|
|
|
|
TT(n) wrote:
Oh you poor thing, you install service packs as directed. lol
You need not defend them, everyone knows how much they stink, except you.
How old are you? 12?
I know full well how much Microsoft "stinks", along with every other major player in the industry. I know that Novell's code quality is WAY behind Microsoft's. I've been doing this stuff since way before you were born, apparently.
And, apparently, you know nothing of how I, the rest of my team, and the rest of the PROFESSIONAL industry beats the hell out of every service pack, patch, and hotfix, BEFORE it goes into production. I know exactly WHAT I'm installing and what it SHOULD fix. Noone worth their salary trusts a corporation to fix their problem until it's tested, tested again, and tested some more. Any problems are reported back to the manufacturer and fixed. I've done it countless times with both Microsoft and Novell. THAT's how professionals handle these issues.
But, I fail to see why your even bringing this up...
TT(n) wrote:
For instance, a common spyware is actually on a comcast cd(broadband) I recieved. It installs it's look-a-like browser, with a some isearch that doesn't even work. The ironic part, is that comcast advertises that they can eliminate certain spyware's, INCLUDING the one on the CD, for a fee ofcour$e.
That's like starting up a windshield repair service, and then at night while no one is looking, go around bashing windows.
And this mean what to me?
TT(n) wrote:
Ok now that it's over.
You stand corrected.
When you feel like growing up and becoming a professional and talking to us in a professional manner, you're more than welcome to come back here and discuss the issues, instead of just telling everyone they're wrong and your right.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Your just so f***ing stupid, it amazes me.
Later a**hole.
|
|
|
|
|
Hi all,
Please help me. How to add the .chm help file into vb.net project.
My application running from IIS.
I tried help.showhelp(me,"filename"). Its working fine coz i stored manually into application folder. The application is running from web browser through IIS server.
But when the client’s are accessing from the website the (compiled) .chm file must download automatically into client PC. How to put the path as well???
Thanks & Regards
Rajad
rajad
|
|
|
|
|
This question really belongs in the ASP.NET Forum.
The path the the client uses to get to the .CHM file will be just like any other file that is served up by your webserver. When your clients hit {F1} on their machine, they'll get the Help for Internet Explorer, not your application. You'll either have to provide a button on your pages that will launch a link to the .CHM file on the server, or you'll have to supply JavaScript code on your pages that will handle downloading the correct .CHM file and launching it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your kind reply.
Sorry it’s not an ASP.net app. It’s a VB.net application and running under IIS server.
I have given below the steps that how our application running:
1). the client will hit the website then the vb.net application will be downloaded into client PC.
2). the help file (.chm compiled) will open when client press the help button.
3). e.g. help.showhelp("XXXX") as per code the file will be openind...
It’s working fine when i am running on my local pc coz the file I stored manually @ my application folder.
4). but when the client running from IIS how to????
Thanks again...
|
|
|
|
|
It's not being run under an IIS Server, it's being deployed by it. There's huge difference...
The best way to deal with this is to create a Web Setup project for your app. That way, all of the files that the app needs will be installed in their proper places.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks you very much. i will try that.
|
|
|
|
|
My directory always get much temporary files after compiling. I always need to pick source files (like *.cpp, *.h etc) one by one when I want to copy them to another folder or backup them. It's so pain
Fortunately, I found a program today, it's very useful to me, maybe it's useful to you too. It can copy or clean specfied type of files and integrate with Explorer, very easy to use.
It's name is Clean Now!(http://www.liuxz.com/cleannow/index.htm) I have installed it in my computer and feel good Usually, I develop with VC6 and C++Builder 6. So I create my own "File Group" like following:
VC 6 Source Files: dsw;dsp;cpp;c;h;hpp;def;clw;lib;opt;rc;ncb;
CBC 6 Source Files: h;hpp;cpp;c;lib;dfm;res;bpr;bpg;
Now, it's very easy to copy my source files to another folder or backup them without garbage: (1) Right click at my source folder (2)Move mouse to "Copy"->"VC 6 Source Files" (3) Select a destinition folder. After a few seconds, all source file and only source files will be copied to destinition folder. I don't need to pick them manually anymore!
If I don't want to copy them out, I just select "Clean"->"VC 6 Source Files", and HOLD SHIFT while clicking. All files EXCEPT source files will be deleted. My source folder become clear
You can try it out if you have interest
code, debug, code, debug ...
I love it!
|
|
|
|
|
Post your ads somewhere else please...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I'm trying to find the new-line characters in a rich text box. The following statement always returns -1 (didn't find any). I've tried searching for vbCrLf, and 10, but to no avail ("e" does find all e's). What can I do to identify the new lines?
i = filestage.Text.IndexOf(vbCr, i + 1)
thanks,
JennyP
|
|
|
|
|
here is one way,
i = RichTextBox1.Text.IndexOf(Chr(10), i)
|
|
|
|
|
This works fine for me:
<br />
Dim i As Integer<br />
Dim MyString As String<br />
MyString = RichTextBox1.Text<br />
i = MyString.IndexOf(vbLf, i + 1)<br />
MsgBox(i.ToString())<br />
|
|
|
|
|
How can I get the number of rows in the data grid programaticaly in VB.Net,where the number of rows dpend on the user entry(the user may add a sum of new rows).
Waleed Eissa
|
|
|
|
|
Windows Forms Faq says to use the BindingManager.Count property
Dim numRows as Integer = dataGridDetails.BindingContext (dataGridDetails.DataSource, _
dataGridDetails.DataMember).Count;
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
Hi,
I am writing an application in VB.NET and want to set an object reference to reference an already open email. Basically I want a user to activate an open email messsage (Outlook being the email client) and then have my application set the object reference (an Outlook MailItem object) to that window which represents that email.
However, I have no idea how to do that. The fact that some of the Window management API functions do not seem to work in VB.NET does not help much. For instance, I tried the simple code below in Excel VBA and it worked fine, but when used in VB.NET it gives an overflow error.
Public Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Public Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Public Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal nMaxCount As Long) As Long
Sub Test()
' Display the title bar text of the foreground window.
Dim hforewnd As Long ' receives handle of foreground window
Dim slength As Long ' length of foreground window's title bar text
Dim wintext As String ' buffer for foreground window's title bar text
Dim retval As Long ' return value
hforewnd = GetForegroundWindow() ' determine the foreground window
slength = GetWindowTextLength(hforewnd) + 1 ' length of its title bar text
wintext = Space(slength) ' make room in the buffer to receive the text
retval = GetWindowText(hforewnd, wintext, slength) ' get title bar text
wintext = Left(wintext, slength - 1) ' remove null character from end of string
End Sub
As I said, the above code works fine in VBA and VB 6 but not in .NET.
Any pointers on how to do this will be greatly appreciated.
Thanks
Vyyk
|
|
|
|
|
I have coded in FORTRAN for many years, where you write code, compile it, link in compiled code from libraries of routines, and run the resulting executable. But we are switching to VB.NET, because we need to write Web Applications. Dynamic link libraries seem like a good choice, but they seem rather complicated. I have also considered Components, and seen references to code libraries and static libraries. We would like to have routines that multiple programmers can use in developing applications. I have muddled through Microsoft Help and MSDN articles, but still don't know what to use. Can anyone help me here.
Glenn W Schreyer
Programmer Analyst II
UTHSC Houston
|
|
|
|
|
If all your looking to do is write a bunch of generic routines that can be used in any app, then your probably looking at the Class Library project. Classes will encompass an entire object, supplying all the methods to manipulate that object. Static (or Shared in VB) classes and methods don't require an instance of the class to work. For an example of this, check out the System.IO namespace. Look for the Directory and DirectoryInfo classes as well as the File and FileInfo classes. The non-Info versions are Static (or Shared in VB), they both versions do just about the exact same thing, they go about them with slight differences.
Design Guidelines for Class Library Developers[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the info. I will read up on Class Libraries. After programming in FORTRAN for so many years, it now seems simple minded compared to VB.NET. At least for me, I have to spend considerable time to learn each new piece of the picture.
Glenn W Schreyer
Programmer Analyst II
UTHSC Houston
|
|
|
|
|