|
Ah, didn't see that. Thought I'd spend a few minutes forum cruising.
Cheers,
Drew.
|
|
|
|
|
Hi all,
First of all, thanks to everybody who offered much needed advice for getting the server set up on my home machine. My program can interface with the server and do some basic operations, which is exactly what was needed.
Second, sorry if this is considered a repost--I posted earlier today about this but didn't get a response. Didn't know if CP sends notifications to everybody in the thread if anything at all is added to the thread, hence why I'm posting here.
My question is pretty simple. I'm trying to log onto the server with a laptop using a username/password combo. What I end up with is, "Login failed for user (this computer)/Guest", where "this computer" is the computer hosting the server.
I've read articles about how to fix this, and most focus on creating a login the server knows about, and using Mixed mode for remote access. But everything I've tried results in that same error message.
How do I make this work? Server machine is WinXP Pro, remote machine is Vista.
Thanks for any advice,
Michael Fritzius
P.S. Actually the next part after this will be to log into the server via the internet, using an IP address. Any tips on that would be appreciated too, so I don't have to make yet another post
|
|
|
|
|
Michael Fritzius wrote: I posted earlier today about this but didn't get a response. Didn't know if CP sends notifications to everybody in the thread if anything at all is added to the thread, hence why I'm posting here.
If you post a reply to yourself, the others who have replied won't get a notice, but if you reply to someone elses post, he/she will get an email.
To your question.
If you want to use SQL Server authentication, you must create a login for yourself (or use an existing one). When you installed the SQL Server instance you were prompted if you want to use Mixed mode authentication. If you selected it, the installation prompted for the password for user SA. You can use that login to connect to the SQL Server. SA is like Administrator in Windows. It has all the privileges in SQL Server. After logging into the SQL Server, you can create additional logins and grant rights to them.
The easiest way to create a login is to use Management Studio. Select from the Object explorer Security/Logins, right click and select New Login. This opens a dialog where you can specify what kind of login you want to create and then grant privileges to the login.
Addition:
Michael Fritzius wrote: the next part after this will be to log into the server via the internet, using an IP address
Basically this is exactly the same as you would connect to your local server. You can define server as ip-address and port, like: 127.0.0.1,1433. You just need to check the port SQL Server is listening using for example Configuration Manager and make sure that you have secure connection over the internet so that the port can be opened for you.
modified on Monday, January 26, 2009 5:53 PM
|
|
|
|
|
Mika,
Thanks for the advice. I didn't know it, but no permissions were set up AT ALL for that user. I knew something was weird at the server side, but couldn't figure it out.
The laptop can now talk with the server, and retrieve info. I'll work on table manipulation next.
Unfortunately, I can't test to see if IP login will work because it's a small network here. So I may be posting for you again soon.
Thanks again,
Michael Fritzius
|
|
|
|
|
Michael Fritzius wrote: no permissions were set up AT ALL for that user
Could it be that you haven't chosen Mixed mode during the setup.
Michael Fritzius wrote: Thanks again
You're welcome
|
|
|
|
|
It was working and I wasn't getting that error mentioned in the subject.
Today I was testing it and logging on from a networked machine doesn't work anymore. I don't remember changing any of the connection strings--my goal was to work with data entry and leave connection strings alone once they were established as working properly.
Is there any reason why this would have worked before and not now?
Thanks,
Michael Fritzius
|
|
|
|
|
If you haven't changed the connection string the most likely reason is that something has changed in Active Directory (if you use integrated security) or in the database privileges.
Open the management studio and check the login you use. Does it still have the privilege to use the database you're interested in (is there a checkbox before your database in the user mapping page)?
|
|
|
|
|
The proper checkboxes were there, yes.
But for whatever reason it now works and I don't think I changed anything.
No idea what caused it to not work before.
But, you were a huge help before and it's likely I did something you suggested without realizing it. So I'll give you credit anyway
|
|
|
|
|
Dear CodeProject Team.
I'had an application maked in C# using MessengerAPI, the app it's terminated and everything works good but I need know How can I launch my app when the microsoft messenger it's started and how can I kill my app when the microsoft messenger it's closed?
Thanks in advanced.
SINCERELY.
ANTHONY ACUÑA
PREFERED PHRASE:
SOMEBODY TELL ME WHY IS MORE REAL WHEN I DREAM THAT I AM WAKE?
|
|
|
|
|
Make another application that will keep check msn messenger in processes, if found run your app, if not found kill your app. Thats it.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi there ..
i looked up in the MSDN about this class
"applicationsecurityinfo"
and couldn't find enough information about it .
And not even in any blog .
Can anyone help me to understand what it is ?
|
|
|
|
|
|
First , i am sorry about my terrible english.
i have a problem to impersonate User account which Exist in the domain ,using md5 hash.
i am using the api's :LogonUser and DuplicateToken.
i had succeed impersonate in default way.
but, when i using the LogonUser i supplying username, password, domain etc..
and i want to use MD5 Hash instead of password parameter.
is there someone who know or have and idea impersonating using md5 hash?, i really appreciate .
|
|
|
|
|
LogonUser requires a plaintext password IIRC. Hashing is irreversible; you cannot practically retrieve the plaintext from the hash. What you might try is using encryption, which can be reversed, then writing a wrapper class which accepts the encrypted text, decrypts it and calls LogonUser with that
You could get the currently logged on user by using System.Security.Principal.WindowsIdentity.GetCurrent().Token, which would give you the same result as LogonUser - a handle
|
|
|
|
|
asafbs2004 wrote: but, when i using the LogonUser i supplying username, password, domain etc..
and i want to use MD5 Hash instead of password parameter.
You can't. The function has no options to accept a hash of the password instead of the plaintext version. It's the plaintext version of the password, or you don't impersonate the user. It's that simple.
|
|
|
|
|
hi guys...
i have a problem with the defraganalysis method...
ManagementClass objMC = new ManagementClass("Win32_Volume");
ManagementObjectCollection objMOC = objMC.GetInstances();
foreach (ManagementObject objMO in objMOC)
{
int result = Convert.ToInt32(objMO.InvokeMethod("defraganalysis", new object[] { true }));
if(objMO["Name"].ToString().Equals("C:\\")) {
break;
}
}
this code works fine, i got the result number but how can i get the properties of the defraganalysis object? as you can see http://msdn.microsoft.com/en-us/library/aa389827(VS.85).aspx[^] ms sais:
uint32 DefragAnalysis(
[out] boolean DefragRecommended,
[out] object DefragAnalysis
);
yes, but how can i get the out parameters?? i've searched the whole internet, but i couldnt find the answer. thx a lot!
|
|
|
|
|
to use the out parameters it would be something like this:
bool recomend;
object analysis;
DefragAnalysis(out recomend, out analysis);
this would assign your local variables with data from within the function
if this is not your requirement then im sorry for misunderstanding the question
|
|
|
|
|
Yeah, there's not much C# sample code for WMI anywhere -- including MSDN. That really sucks because WMI isn't very intuitive. I tested WMI for 8+ years and still struggle with some features...
The DefragAnalysis method returns 3 things: return code (which you got), a bool that indicates whether or not a defrag is recommended, and an instance of Win32_DefragAnalysis. The bool & instance get "wrapped" in an object array. All you have to do is tell the method where to put the objects. Think of the "outParams" array as a mailbox with 2 slots. Null values are fine.
Here's some sample code. (Note, it isn't necessary to specify scope for Vista or Server 2008 because the defaults are local machine & “root\cimv2”. I only included it for backward compatibility.)
using System;
using System.Management;
namespace DefragAnalysis
{
class Program
{
static void Main(string[] args)
{
try
{
string scope = @"\\.\root\cimv2";
string query = @"SELECT * FROM Win32_Volume WHERE Name = 'C:\\'";
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
object[] outputArgs = new object[2];
foreach (ManagementObject volume in searcher.Get())
{
UInt32 result = (UInt32)volume.InvokeMethod("DefragAnalysis", outputArgs);
if (result == 0)
{
Console.WriteLine("Defrag Needed = {0}\n", outputArgs[0]);
ManagementBaseObject defragAnalysis = outputArgs[1] as ManagementBaseObject;
if (null != defragAnalysis)
{
foreach (PropertyData property in defragAnalysis.Properties)
{
Console.WriteLine("{0} = {1}", property.Name, property.Value);
}
}
}
else
{
Console.WriteLine("Method return code = 0x{0:X}", result);
}
}
}
catch (Exception ex)
{
Console.WriteLine("Something bad happened.\n" + ex);
}
finally
{
Console.WriteLine("\npress any key to exit...");
Console.ReadKey();
}
}
}
} OUTPUT:
Defrag Needed = False
AverageFileSize = 210971
AverageFragmentsPerFile = 1.01
AverageFreeSpacePerExtent = 1486924
ClusterSize = 4096
ExcessFolderFragments = 2
FilePercentFragmentation = 0
FragmentedFolders = 2
FreeSpace = 51929346048
FreeSpacePercent = 43
FreeSpacePercentFragmentation = 30
LargestFreeSpaceExtent = 23083888640
MFTPercentInUse = 72
MFTRecordCount = 286135
PageFileSize = 0
TotalExcessFragments = 2833
TotalFiles = 250258
TotalFolders = 35176
TotalFragmentedFiles = 876
TotalFreeSpaceExtents = 34924
TotalMFTFragments = 3
TotalMFTSize = 403636224
TotalPageFileFragments = 0
TotalPercentFragmentation = 15
TotalUnmovableFiles = 149
UsedSpace = 66455265280
VolumeName =
VolumeSize = 118384611328
press any key to exit...
|
|
|
|
|
Hi all,
I’ve been stuck with this problem for around two days now, and have been trawling the forums looks for help.
Any help would be great.
I have a windows form application which calls external applications, including commandline calls to subversion.
I have a rich textbox on my forum where I redirect the output from cmd to. Everything works great, but the form freezes and the textbox does not show until I do a messagebox.show or something similar. I have come to the conclusion that I need to do the external processes on a worker thread. To be honest I have not got much further than that.
I have a function called commandLine() which takes various parameters such as command, working dir. etc. im thinking that I should place this on a separate thread but not sure how to go about it as within this function I redirect the output to another function which deals with putting the text into the rtb, and a text file.
I have been looking at the threading and the backgroundworker, but have no idea how to get started at all!
Any advice on how to get started, hints and tips, use threading or backgroundworker would be great. Just a quick summary:
Thread needs to take multiple parameters and pass various string values back to the form thread.
Hope this makes sense!
Cheers
|
|
|
|
|
|
|
Lol we linked the same article.
|
|
|
|
|
Create a class that has a backgroundworker object in it, and have that backgroundworker object use a Process object to run your external app. I have some code that might help, but that means I would have to write an article to go with it.
I guess I could post it here... in a message...
[EDIT] Nope - it's too big to post here. I'll have to write an article.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
The Device has 4 videos capture entrance, the difficulty is to have access the library.(Drivers and API)
Thanks by the atençao!!
|
|
|
|
|
How many times are you going to ask? Read the documentation of your devices and read the posts people have given you already.
Stop repeating your question.
|
|
|
|