私は現在ウェブサイトを開発していますが、適切な解決策を見つけるのに苦労しています。
別のブラウザーから自分のサイトを開き、同時に AJAX 呼び出しを行おうとすると、両方のブラウザーが要求を処理しているため、エラーが発生します。
サーバーが現在 AJAX 呼び出しを実行しているかどうかを検出し、最初の要求が完了するまで待ってから 2 番目の要求を実行する方法はありますか?
これは、異なるブラウザーを使用して同時に ajax リクエストを作成しようとしたときのコードです
using (StreamWriter sw = new StreamWriter(hhpPath + "\\Contents\\" + Path.GetFileName(hhpPath).ToString() + ".hhp", false))
{
sw.WriteLine("[OPTIONS]");
sw.WriteLine("Compatibility=1.1 or later");
sw.WriteLine("Compiled file=" + hhpPath + "\\Unpublished\\"+ Name +".chm"); //the file to be converted
sw.WriteLine("Contents file=" + (hhpPath + "\\Contents\\" + Path.GetFileName(hhpPath).ToString()) + ".hhc"); //TOC file
sw.WriteLine("Default topic=" + "Installing the Prototype Terminal.html");
sw.WriteLine("Display compile progress=no");
sw.WriteLine("Index file=" + (hhpPath + "\\Contents\\" + Path.GetFileName(hhpPath).ToString()) + ".hhk"); //index file
sw.WriteLine("Title=none");
sw.WriteLine("\r\n[FILES]");
sw.WriteLine("none");
}
エラーは、ファイルが現在使用中であることを示しています。