windows-vista interview questions
Top windows-vista frequently asked interview questions
I am using eclipse 3.4.1 Java EE under Vista. It seems to like getting stuck when building my workspace. Canceling the build doesn't seem to do anything as well.
Why is this happening and how do I fix the problem?
Source: (StackOverflow)
How can I launch an application using C#?
Requirements:
Must work on XP and VISTA?
I have seen a sample from DinnerNow.net sampler that only works in vista?
Source: (StackOverflow)
I'm using the following code on Windows Vista Ultimate SP1 to query our active directory server to check the user name and password of a user on a domain.
public Object IsAuthenticated()
{
String domainAndUsername = strDomain + "\\" + strUser;
DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, strPass);
SearchResult result;
try
{
//Bind to the native AdsObject to force authentication.
DirectorySearcher search = new DirectorySearcher(entry) { Filter = ("(SAMAccountName=" + strUser + ")") };
search.PropertiesToLoad.Add("givenName"); // First Name
search.PropertiesToLoad.Add("sn"); // Last Name
search.PropertiesToLoad.Add("cn"); // Last Name
result = search.FindOne();
if (null == result)
{
return null;
}
//Update the new path to the user in the directory.
_path = result.Path;
_filterAttribute = (String)result.Properties["cn"][0];
}
catch (Exception ex)
{
return new Exception("Error authenticating user. " + ex.Message);
}
return user;
}
the target is using .NET 3.5, and compiled with VS 2008 standard
I'm logged in under a domain account that is a domain admin where the application is running.
The code works perfectly on windows XP; but i get the following exception when running it on Vista:
System.DirectoryServices.DirectoryServicesCOMException (0x8007052E): Logon failure: unknown user name or bad password.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
at System.DirectoryServices.DirectorySearcher.FindOne()
at Chain_Of_Custody.Classes.Authentication.LdapAuthentication.IsAuthenticated()
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
at System.DirectoryServices.DirectorySearcher.FindOne()
at Chain_Of_Custody.Classes.Authentication.LdapAuthentication.IsAuthenticated()
I've tried changing the authentication types, I'm not sure what's going on.
See also: http://stackoverflow.com/questions/290548/c-validate-a-username-and-password-against-active-directory
Source: (StackOverflow)
I am unable to start glassfish because it keeps showing this error message:
SEVERE: Shutting down v3 due to startup exception : No free port within range: 8080=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@ed7d1
How can I find what applications are using what ports in windows vista.
I have tried using nmap zenmap using the following target:
http://127.0.0.1:8080
but all I get is this:
Starting Nmap 5.51 ( http://nmap.org ) at 2011-08-05 12:05 Central Daylight Time
NSE: Loaded 57 scripts for scanning.
Read data files from: C:\Program Files\Nmap
Nmap done: 0 IP addresses (0 hosts up) scanned in 4.55 seconds
Raw packets sent: 0 (0B) | Rcvd: 0 (0B)
WARNING: No targets were specified, so 0 hosts scanned.
Source: (StackOverflow)
I have a small script that performs the build and install process on Windows for a bazaar repository I'm managing. I'm trying to run the script with elevated, administrative privileges from within the Windows Shell (cmd.exe)--just as if I'd right-clicked it and chosen Run as Administrator, but without using any method that requires use of the Graphical Interface.
I don't see any answer to this on the net or here on stackoverflow, but after an hour or so of searching, I managed to piece together an answer, which I have posted below. Feel free to provide alternate or expanded answers, however.
Source: (StackOverflow)
This question already has an answer here:
I'm using HttpListener to allow a user to set up a proxy on a user-defined port. When I start the HttpListener, I get an exception if the application isn't running under administrator privileges in Vista.
From what I've read, this is expected behavior - administrator privileges are required to start listening on a port. But I'm sure there are ways around this, as I run plenty of programs (like Skype) which listen on a port without requiring elevation to administrator.
Is there a way to do this with HttpListener? If not, can I make other API calls in .NET code to set up the port?
Source: (StackOverflow)
I want to use Exuberant Ctags on Vista (and probably the XP laptop) at work; no choice about the OS. I'm use GVim instead of the Flex Builder recommended by my co-worker, because the FB is buggy and doesn't do what GVim does, anyway. I got the zip file here. The Ctags install file says, among other things:
mk_bc3.mak For MSDOS using Borland C/C++ 3.x
mk_bc5.mak For Win32 using Borland C++ 5.5
mk_djg.mak For MSDOS using DJGPP Gnu GCC (better to follow Unix install)
mk_ming.mak For Win32 using Mingw32
mk_mvc.mak For Win32 using Microsoft Visual C++
I don't really understand what all that means (I have some grasp of each idea individually, but not put together like this), but I chose the last option as sounding Most Likely to Succeed. I opened the command prompt as Administrator, cd'd to the unzipped ec57w32 folder, and typed mk_mvc.mak.
Visual Studio welcomed me to the conversion wizard, offered to make a backup before proceeding to which I assented, and conversion failed. The conversion log says, Cannot load the project due to a corrupt project file. Same thing happened when I downloaded again, unzipped again, and did not make backup files; and also when I tried each of the other mk commands. There weren't any other choices along the way.
What else can I try?
Source: (StackOverflow)
I have a .NET 3.5 Web application on VS 2008 SP1 running on Vista Ultimate 32 SP1. I created an Application under the Default Web Site. So the url to the app is "http://localhost/mysite". The application folder is pointing to the solution folder and it is outside the iisroot folder. Anonymous and Integrated Auth (Windows) is enabled in IIS7 for this web application "mysite".
I gave full permissions to "Network Service" user to the application folder (which is outside of iisroot).
When I hit F5 to star debugging, I get the "Unable to start debugging on the web server. The web server could not find the requested resource." error.
I fired up TcpView (Sysinternals) to see what app is actually running and keeping an handle on that port and I found out there is no app listening on that port. This is really weird... Any creative ideas?
I can hit the URL "http://localhost/mysite" without a problem. That web application is set up to be the start up project and Default.aspx is the start up page.
There is an .asmx service in the prject as well. The Default.aspx is making use of that asmx service. The AutoCompleteExtender (From the AJAX Control Toolkit) is using this asmx service.
Everything works by the way. The issue is the debugging... I suspect the asmx service is causing this but i don't know. This is driving me nuts...
Source: (StackOverflow)
Is there a way to debug javascript using Safari 3.2 in Windows Vista?
I found a link to a debugger named Drosera but I can't get it to work because the information seams to be outdated.
Source: (StackOverflow)
How, in the simplest possible way, distinguish between Windows XP and Windows Vista, using Python and pywin32 or wxPython?
Essentially, I need a function that called will return True iff current OS is Vista:
>>> isWindowsVista()
True
Source: (StackOverflow)
I'm using Windows Vista Ultimate and I want to know what is the best C++ compiler for my Windows. On Linux I use gcc and g++.
Source: (StackOverflow)
Which built in (if any) tool can I use to determine the allocation unit size of a certain NTFS partition ?
Source: (StackOverflow)
Unable to test sending email from .NET code in Windows Vista Business.
I am writing code which I will migrate to an SSIS Package once it its proven. The code is to send an error message via email to a list of recipients.
The code is below, however I am getting an exception when I execute the code.
I created a simple class to do the mailing... the design could be better, I am testing functionality before implementing more robust functionality, methods, etc.
namespace LabDemos
{
class Program
{
static void Main(string[] args)
{
Mailer m = new Mailer();
m.test();
}
}
}
namespace LabDemos
{
class MyMailer
{
List<string> _to = new List<string>();
List<string> _cc = new List<string>();
List<string> _bcc = new List<string>();
String _msgFrom = "";
String _msgSubject = "";
String _msgBody = "";
public void test(){
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("me@domain.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is a sample body";
mail.IsBodyHtml = false;
//send the message
SmtpClient smtp = new SmtpClient();
smtp.Host = "emailservername";
smtp.Port = 25;
smtp.UseDefaultCredentials = true;
smtp.Send(mail);
}
}
Exception Message
Inner Exception
{"Unable to read data from the transport connection: net_io_connectionclosed."}
Stack Trace
" at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)\r\n at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)\r\n at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)\r\n at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)\r\n at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)\r\n at System.Net.Mail.SmtpClient.GetConnection()\r\n at System.Net.Mail.SmtpClient.Send(MailMessage message)"
Outer Exception
System.Net.Mail.SmtpException was unhandled
Message="Failure sending mail."
Source="System"
StackTrace:
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at LabDemos.Mailer.test() in C:\Users\username\Documents\Visual Studio 2008\Projects\LabDemos\LabDemos\Mailer.cs:line 40
at LabDemos.Program.Main(String[] args) in C:\Users\username\Documents\Visual Studio 2008\Projects\LabDemos\LabDemos\Program.cs:line 48
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.IOException
Message="Unable to read data from the transport connection: net_io_connectionclosed."
Source="System"
StackTrace:
at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
InnerException:
Source: (StackOverflow)
What is the difference between the new TFileOpenDialog and the old TOpenDialog?
In my computer (Win 7/DXE), when I run the code, the dialogs look the same.
Source: (StackOverflow)