سؤال

ولقد واجهت خطأ غريب بعض الشيء أن أنا لا أفهم. أنا خلقت تطبيق وحدة C # الذي صمم ليكون مجرد اختبار لمعرفة ما إذا خدمة الويب الخاص بي كان يعمل من خارج شبكة الاتصال. وكان كل ما فعلته محاولة الاتصال خدمة ويب، خرج كل مرحلة إلى وحدة التحكم والكتابة إلى ملف نصي بحيث يمكن ان ترسل لي السجلات.

وعملت تماما على 3 XP آلات (واحد داخل شبكة بلدي، 2 خارج). (كان ملف واضح) آلة فيستا ولكن على بلدي زعماء آلة XP (انه هو الرجل IT حتى لا تعرف ما يفعل)، فإنه رمى خطأ غريب جدا.

وC: \ مؤقت \ testwe ~ 1.EXE وحدة المعالجة المركزية NTVDM واجه التعليمات غير قانوني

وhttp://www.houseofhawkins.com/roger.jpg ">

وفعلت بعض غوغلينغ وبدا وكأنه قد تم buggered NTVDM له، أو كان هناك فيروس أو شيء من هذا. يبدو أن أيا من هذه أن يكون عليه الحال. لا استطيع ان ارى ما يمكن أن يحدث لسبب هذا الفشل في مثل هذه الطريقة.

وباستخدام النظام. باستخدام System.Collections.Generic. باستخدام System.Text. باستخدام System.IO؛

ومساحة testwebservice {     برنامج الدرجة     {         يقوم FileStream theFile = فارغة؛         StreamWriter الكاتب = فارغة؛

    static void Main(string[] args)
    {
        Program p = new Program();
        p.testMe();
    }

    private void testMe()
    {
        Console.WriteLine("Entered main method about to create stream");            
        try
        {
            theFile = File.Create(@"jonTestWebService.log");
            writer = new StreamWriter(theFile);
            writer.AutoFlush = true;

            try
            {
                message("Starting test at: " + DateTime.Now.ToLongTimeString());

                Random rand = new Random();

                message("creating new instance of webservice");
                houseofhawkins.testweb webServ = new testwebservice.houseofhawkins.testweb();

                message("calling hello world");
                String helloResult = webServ.HelloWorld();
                message("hello world result = " + helloResult);

                int one = rand.Next(999);
                int two = rand.Next(999);
                message("calling maths method with " + one + " + " + two);
                String mathResult = webServ.mytestMethod(one, two);
                message("Math result is: " + mathResult);



                message("Creating instance of CSJawbreaker");
                CSJawbreaker.InformationService csj = new testwebservice.CSJawbreaker.InformationService();

                message("trying to get the latest version number");
                float version = csj.latestVersionNumber();
                message("Version number: " + version.ToString());

                message("");
                message("Finished all processing at: " + DateTime.Now.ToLongTimeString());
            }
            catch (Exception ex)
            {
                writer.WriteLine("");
                writer.WriteLine(ex.Message);
                writer.WriteLine("");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("could not create stream Writer, " + ex.Message);
        }

        message("");
        message("Press return to exit");
        Console.ReadLine();

        writer.Close();
        theFile.Close();
    }

    private void message(String message)
    {
        if (theFile != null && writer != null)
        {
            Console.WriteLine(message);
            writer.WriteLine(message);
        }
    }
}

و}

وأنا عالقة جدا لماذا يمكن للرمز أعلاه / سيفعل هذا. ذلك هو نوع من مجرد أريد أن أعرف وجزئيا، وهذا يمكن أن يحدث لآلة عملاء حقيقية، أو هو مجرد بلدي الرؤساء الجهاز المصاب أو شيء من هذا.

وشكرا

هل كانت مفيدة؟

المحلول

وشيء خاطئ جدا إذا كنت في نهاية المطاف في NTVDM، وهذا هو 16 بت DOS طبقة مضاهاة لXP. وإذا حدث ذلك مرة أخرى بعد إعادة نسخ EXE عبر، فما استقاموا لكم فاستقيموا تحقيق في البرامج المثبتة على جهاز الكمبيوتر رئيسك (.NET Framework الإصدار، وما إلى ذلك).

ويهمني أيضا محاولة تشغيل هذا في WinDbg لنرى أين كنت في نهاية المطاف، والحصول على مكدس الاستدعاءات بمجرد أن أخطاء من غيرها، وأراهن أنك سوف تجد وحدة غريبة على المكدس (التجسس، الخ).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top