Click here to Skip to main content
15,067,335 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have to get the chrome profile path programmatically and show it in textbox.

What I have tried:

I have tried this...chrome://version/ but I didn't get any idea how can we use this chrome://version in winform and get it in textbox.
Posted
Updated 29-Jan-21 0:14am
v2
Comments
Richard Deeming 29-Jan-21 6:37am
   
REPOST
You have already posted this question:
How to fetch the chrome profile path programmatically using c#.net[^]

1 solution

I order to do it, you need to know the user who is logged in - and unless you are actually using Chrome and running as a part of that process, there is no way to "just get" the value because the user can change profiles on the fly - that's why Rick suggested the chrome://version/ switch klast time you asked this question: https://www.codeproject.com/Questions/5293418/How-to-fetch-the-chrome-profile-path-programmatica[^]

Basically, you can't do it from your app: the best you can do is look under the LocalData folder for the Windows currently logged in user - which you have the code for - append the chrome subfolders "Google\Chrome\User Data\" and hop you can find something there.

But I'd say that probably you are trying to do something the long way round, and you should start by thinking about what you are trying to achieve that you think this will help, as it's unlikely that this is the right approach at all!
   
Comments
Member 15028582 29-Jan-21 6:41am
   
Actually sir I need to capture the chrome history.....This is my code.....
string sourceFile = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Google\Chrome\User Data\Default\";

I need to find that subfolder only by using coding.....Because In my system the chrome history is stored in default folder and other system the chrome history is profile folder.....so that only I need to capture the subfolders also by code....Is there any idea

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900