"Unable to find manifest signing certificate in the certificate store"
Bu hata yüzünden derlemenize izin vermiyecektir.



source = new List<string>() {"araba","peugeot","fiat","motor","kaya öner","öner kaya", "volvo","wosvagen","mercedes","bmw","audi","dacia", "hyundai","honda","lada","lotus","alfa romeo", "land rover","renault","volkswagen","tata","nissan","opel","mazda" ,"kia","jeep","jaguar","isuzu","citroen"};
public static int FindLevenshteinDistance(this string Source, string Target)
{
int n = Source.Length;
int m = Target.Length;
int[,] Matrix = new int[n + 1, m + 1]; // Hesaplama matrisi üretilir.
if (n == 0) // Eğer kaynak metin yoksa zaten hedef metnin tüm harflerinin değişimi söz konusu olduğundan, hedef metnin uzunluğu kadar bir yakınlık değeri mümkün olabilir
return m;
if (m == 0)
return n;
// Aşağıdaki iki döngü ile yatay ve düşey eksenlerdeki standart 0,1,2,3,4...n elemanları doldurulur
for (int i = 0; i <= n; i++)
Matrix[i, 0] = i;
for (int j = 0; j <= m; j++)
Matrix[0, j] = j;
// Kıyaslama ve derecelendirme operasyonu yapılır
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
{
int cost = (Target[j - 1] == Source[i - 1]) ? 0 : 1;
Matrix[i, j] = Math.Min(Math.Min(Matrix[i - 1, j] + 1, Matrix[i, j - 1] + 1), Matrix[i - 1, j - 1] + cost);
}
return Matrix[n, m]; // sağ alt taraftaki hücre değeri döndürülür
}
Kelimelerin benzerlik durumlarının derecesini ben dinamik olarak kelime uzunluğuna göre ayarlamaktayım. public IEnumerableşimdi asıl işlemi yapan, benzerliği hesaplıyan algoritmamıza gelelim. bunun için ufak bir extention yazarak gerçekleştirdim.GetSimilarWords(string sourceWord) { IEnumerable tmp; tmp = source.Where(s => sourceWord.FindLevenshteinDistance(s) <= dynamicLimit(s.Length)); return tmp; }
public static int FindLevenshteinDistance(this string Source, string Target)
{
int n = Source.Length;
int m = Target.Length;
int[,] Matrix = new int[n + 1, m + 1]; // Hesaplama matrisi üretilir.
if (n == 0) // Eğer kaynak metin yoksa zaten hedef metnin tüm harflerinin değişimi söz konusu olduğundan, hedef metnin uzunluğu kadar bir yakınlık değeri mümkün olabilir
return m;
if (m == 0)
return n;
// Aşağıdaki iki döngü ile yatay ve düşey eksenlerdeki standart 0,1,2,3,4...n elemanları doldurulur
for (int i = 0; i <= n; i++)
Matrix[i, 0] = i;
for (int j = 0; j <= m; j++)
Matrix[0, j] = j;
// Kıyaslama ve derecelendirme operasyonu yapılır
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
{
int cost = (Target[j - 1] == Source[i - 1]) ? 0 : 1;
Matrix[i, j] = Math.Min(Math.Min(Matrix[i - 1, j] + 1, Matrix[i, j - 1] + 1), Matrix[i - 1, j - 1] + cost);
}
return Matrix[n, m]; // sağ alt taraftaki hücre değeri döndürülür
}
Projeyi indirmek için ; https://docs.google.com/file/d/0ByRFI3ULXVPuRkJNTXBXQjk4LW8/edit?usp=sharingstatic void Main(string[] args)
{
var iisSiteList = IISManager.GetIISSiteList();
HttpOp ho = null;
foreach (SiteInfo si in iisSiteList)
{
ho = new HttpOp("http://" + (si.SiteUrl != string.Empty ? si.SiteUrl : "localhost:" + si.Port));
ho.DownloadSite();
if (ho.IsSiteDownloaded)
Console.WriteLine(si.SiteUrl + " sorunsuz çalışmaktadır");
else
{
Console.WriteLine((si.SiteUrl != string.Empty ? si.SiteUrl : "localhost:" + si.Port) + " hata çıktı.");
IISManager.RecycleSite(si.ApplicationPoolName);
}
}
Console.ReadKey();
}
public static ListGetIISSiteList() { List tmpList = new List (); using (ServerManager manager = new ServerManager()) { var sites = manager.Sites; foreach (Site s in sites) { SiteInfo a = new SiteInfo(); a.SiteName = s.Name; if (s.Bindings.Count > 0) { a.SiteUrl = s.Bindings[0].Host; a.Protocol = s.Bindings[0].Protocol; a.Port = s.Bindings[0].EndPoint.Port; } if (s.Applications.Count > 0) { a.ApplicationPoolName = s.Applications[0].ApplicationPoolName; } tmpList.Add(a); } } return tmpList; }
public static void RecycleSite(string poolName)
{
using (ServerManager manager = new ServerManager())
{
ApplicationPoolCollection applicationPools = manager.ApplicationPools;
foreach (ApplicationPool pool in applicationPools)
{
if (pool.Name == poolName)
{
if (pool.State == ObjectState.Stopped)
{
pool.Start();
Console.WriteLine(pool.Name + " sitesi durmus. Yeniden Start edildi.");
}
else
{
pool.Recycle();
Console.WriteLine(pool.Name + " sitesi recycle edildi.");
}
manager.CommitChanges();
continue;
}
}
applicationPools.Clear();
return;
}
}
public void DownloadSite()
{
StringBuilder sb = new StringBuilder();
byte[] buf = new byte[8192];
//try-catch => url yanlis olma durumu, site nin hata verme durumunu kontrol edebilmek icin
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(siteUrl);
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
using (Stream resStream = response.GetResponseStream())
{
int count = 0;
do
{
count = resStream.Read(buf, 0, buf.Length);
if (count != 0)
{
sb.Append(Encoding.GetEncoding(65001).GetString(buf, 0, count));
}
}
while (count > 0);
resStream.Close();
response.Close();
isSiteDownloaded = true;
}
}
}
catch (WebException e)
{
isSiteDownloaded = false;
htmlError = e;
try
{
using (StreamReader hataoku = new StreamReader(e.Response.GetResponseStream()))
{
sb.Append(hataoku.ReadToEnd().ToString());
}
}
catch (Exception ex) { htmlError = new WebException(ex.Message, ex.InnerException); }
}
}