„“““))
using System;
using System.Collections;
using System.ComponentModel;
using System.Net;
using System.Net.Sockets;
using System.Xml;
using System.Threading;
using System.Text;
using System.IO;
using Microsoft.Win32;
using System.Diagnostics;
namespace Network.Helper
{
/// <summary>
/// Ermittelt die Proxy Einstellungen von Mozilla Firefox
/// </summary>
public class MozillaFirefoxProxySettings
{
/// <summary>
/// Adresse des eingestellten Proxyservers.
/// </summary>
public static string IP
{
get
{
try
{
string data = read_key("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "AppData");
string[] files = System.IO.Directory.GetDirectories(data + "\Mozilla\Firefox\Profiles");
foreach (string profile in files)
{
StreamReader reader = File.OpenText(profile + "\prefs.js"); // open file
for (int i = 0; -1 != reader.Peek(); i++) // read file
{
string line = reader.ReadLine();
// search XXX in user_pref("network.proxy.http", "XXX");
if (line.StartsWith("user_pref("network.proxy.http""
Alte URL:
/snippet/ermittelt-die-proxy-einstellungen-von-mozilla-firefox/14
Würde auf einheitlichen Codestil achten 😉 Sonst ist das Snippet ohne grössere Änderungen nicht wirklich brauchbar.
Beziehe mich jetzt auf die Variabelnamen und der Methodenname zum Lesen der Regestry
Gruss,
Gregor