you got the point. This method fails when web server is not one of the allowed machines for user to log on to.
sianatia
Posts
-
PrincipalContext not working in 2008 r2 Domain -
PrincipalContext not working in 2008 r2 DomainThe domain name is correct. Webserver is not in the DMZ and it is connected to AD. This method does not work if users are restricted to logon to certain stations. Whats more, I used to query users group using DirectoryEntry and since we promoted our domain from 2003 to 2008 r2, only dmain admins can query users group. We have not changed any policy or any setting in the AD.
-
PrincipalContext not working in 2008 r2 DomainI do it the same, but when I set LogOn to for my users ,ValidateCredentials returns false. I want to use this method on my web applications but My users must have right to logon to my web server
-
PrincipalContext not working in 2008 r2 DomainI used to use PrincipalContext for authenticating my users in my 2003 domain network. My users were restricted to log on to specific stations. After moving our servers to 2008 domain, PrincipalContext is not working and needs unrestricted access to all stations in the network. This puts a big risk on my enterprise network since everyone can log on to all stations. I want to know if there is any another way to authenticate users against 2008 domain. P.S. I used DirectoryEntry and it faces the same problem. Thanks
-
landscpae printinghi there here is some code for more:
using System; using System.IO; using System.Diagnostics; using System.Data.SqlClient; using System.Drawing; namespace test { public class Class1 { public static void Main() { System.Drawing.Printing.PrintDocument doc=new System.Drawing.Printing.PrintDocument(); doc.QueryPageSettings +=new System.Drawing.Printing.QueryPageSettingsEventHandler(doc_QueryPageSettings); doc.PrintPage +=new System.Drawing.Printing.PrintPageEventHandler(doc_PrintPage); doc.Print(); } private static void doc_QueryPageSettings(object sender, System.Drawing.Printing.QueryPageSettingsEventArgs e) { e.PageSettings=new System.Drawing.Printing.PageSettings(new System.Drawing.Printing.PrinterSettings()); e.PageSettings.PaperSize =new System.Drawing.Printing.PaperSize("Custom Size",8230,4330); e.PageSettings.Landscape=true; e.PageSettings.Margins.Left=e.PageSettings.Margins.Left= e.PageSettings.Margins.Left=e.PageSettings.Margins.Left=0; } private static void doc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.PageUnit=System.Drawing.GraphicsUnit.Millimeter; Font fnt=new Font("Tahoma",14,FontStyle.Bold); StringFormat sf=new StringFormat(StringFormatFlags.DirectionRightToLeft); sf.LineAlignment=StringAlignment.Near; sf.Alignment=StringAlignment.Near; Rectangle rec=new Rectangle(113,12,83,17); e.Graphics.DrawString("Some Text Goes here",fnt,Brushes.Black,rec,sf); } } }
when I print using this code in portrait the text excatly prints in the locataion 83:17 but in landscape no test presents. Note that I use my own paper size. -
landscpae printingHi there I have a major problem with ladscape printing. when I print my documnet by PrintDocument on portrait paper it works well and every ponit prints in its own location but when I want to print in landscape all the positionings get changed in a way that some points get printed out of the paper bounds. What is my mistake in landscape printing? thanks.
-
IO problemHi, This is my code:
System.IO.FileStream file=System.IO.File.OpenWrite(_fileName);//file to be written System.IO.MemoryStream ms=new System.IO.MemoryStream();//in memory stream for some puspose dataset.WriteXml(ms);//write dataset into memory stream ms.Position=0; byte[] buffer=new byte[ms.Length];//create buffer ms.Position=0; ms.Read(buffer,0,buffer.Length);//read memory stream ms.Close(); file.Position=0; file.SetLength(0); //flush the main file buffer=System.Text.Encoding.UTF8.GetBytes(Encrypter.EncryptData(System.Text.Encoding.UTF8.GetString(buffer)));//encrypt data file.Write(buffer,0,buffer.Length);//write dato into main file file.Close();//close file
Just one process can write on main file,other processes like backup process may read this file. -
IO problemHi I have designed an application which creates and uses an encoded XML file as its database.Some times overnothng this file gets damaged. I put a backup service for this app to check the file every 20 seconds and if it finds errors in the file it will restore the backup.The point is sometimes althought the file is broken ,the backup service finds this file as correct.also the program continues working with the file untill it gets closed.After closing the program the problems raise I face a big loss in data. Could anyone tell me what the problem is and why before closing the app the file seems to be correct but after closing the app file gets corrupted. Thanks
-
parallel programming and multi threading in the Apllication layerhi I have a major problem.I am designing a simple simulator for my college project,in this simulator I may have some code running simultanesly (vitrual).I mean, in this simulator ,simulator engine may wait on an object and run another object an then return back to the original object like what we have in calling Methods.In this way parallel programming and multi threading in the Apllication layer comes possible. I need to know if I can do this by halting execution in some point of the code manulay and run another code and the return back to the original code.This simulator runs on a single thread and may have many objects in it and can not have one thread per each object in order to use Mutex. Thanks
-
Transparency in TxxtboxRight,but id there any way to do what i want?
-
Transparency in Txxtboxwell,i have a textbox and i want to show something over it ,using label didn't solve my problem because when i put the label on the textbox,it covers textbox,although i have set the transparency of the label.I tried to use panel but it didn't work the same way. Thanks
-
Transparency in TxxtboxHi, when we set the backcolor of a panel to Transparent,it works but when we hover or put the panle on a TextBox the backcolor shows as Control BackColor and no more transparency is supported. How can we enable the trasparency of the textbox? thanks
-
Printing using LPTofcourse .Net does not suppport line control because when you want to print by .Net it just prints the page and you can not for example force the print to advance one line not one page,this is my problem...
-
Printing using LPTi mean when we are using .net to print
-
Printing using LPTit is so,but the point is when we are using windows to print,there is no control over pages and lines of printing which causes so many trouble in continuos papers.
-
Printing using LPThi there, I use LPT for printing my documents because i want to control my pages and lines,but when i want to print an image it takes too long to convert the image into monochrome bitmap for black/white printers and also there is a puase between each line of printing.I want to know how Windows prints images so fast... thanks
-
send data over modemhi there, i use TAPI to control modem,now i can dial or hang up but i dont know how to send data over a connected line,what should i do? thanks
-
disabling devicehi there, i have an application which works with modem,i put the modem in the listening state,but i want to do this in some specific times.how can i do this by using C#?
-
disabling devicehi, how can i disable or enable a device using c#?
-
using files on a mapped network drive [modified]hi there, I have some files in my network that i have to use,when i run a Windows app it works and system can find the file on the mapped drive but when i run a service to take the role of the app, the system can not find the files,although the user is identical for both the service and the app, what should i do? thanks