I am use Windows 7 64 bit & VS 2019. Save the W7 comments please
Because Google has forced users to use Chrome to view YouTube videos I have made some changes to a VB.Net app I wrote that
stores url links in a SQLite DB when the link is selected from
a DGV the YouTube channel opens in chrome now.
I would like to have VB.Net or C# code to Clear Browsing Data
in chrome when I exit the app.
Below is the code that closes the app with my feeble attempt
at Clearing Browsing Data
IMPROVE Question Idea
OK I assume that chrome shows a Web Page written in JavaScript to let me click a button to Clear Browsing Data SO if I can embed JS code in my VB.Net app I should be able to mimic the JS code chrome uses ? ? Issue I know very limited JS and embedding the code way beyond my pay grade! Back to searching this idea.
Suggestions about this approach would be helpful I am not asking for anyone to write my code just comment on this approach or point me to worthwhile resources Thanks
Second IMPROVED "Updated What I Have Tried"
What I have tried:
Here is what I have accomplished. I have found the path to where Google Chrome keeps Cache_Data and how to manipulate the data in the folder "code below"
What I do not know and am not sure I want to test deleting the files in this folder
Que the Knees Knocking. When I use the Google settings to clear browser data all the files named f_00000a format are removed but the files named data_0 up to data_3 & index are NOT deleted
Question is If I delete all the files in the folder will the necessary files data_0 & index get recreated ? And
Filter deleting only the files with this named structure f_00000a ?
Dim aE As String
''aE = "C:\Users\Dwight\AppData\Local\Google\Chrome\User Data\Default\Cache\Cache_Data"
aE = "C:\A A A Junk"
''lk = "chrome.exe"
If Asc(e.KeyChar) = 27 Then
Process.Start(aE)
If My.Computer.FileSystem.FileExists("") Then ' Then 'Check whether file exists
End If
'My.Computer.FileSystem.CopyFile("C:\A A A JunkTwo\f_00000a", "C:\A A A Junk\f_00000a")
My.Computer.FileSystem.CopyDirectory("C:\A A A Junk", "C:\A A A JunkTwo", True)
'My.Computer.FileSystem.DeleteFile("C:\A A A JunkTwo\f_00000a") 'Delete the file!
End If