T./?O
Joshua Lunsford
Posts
-
REGEX start and end -
Scaling a PolygonI think I have to plug my values into a matrix and scale the vectors based off of a reference point(like you said) which I'm just going to cheat and find the average of the X coords and the Y coords for that reference point. But the Matrix.Scale method doesn't support a certain reference point so i would have to extend the method and thats a pain, or i'm just lazy. But if anyone has done such a thing(scaling a 2d polygon from a reference point) please assist. Thanks!
-
Scaling a PolygonI have an application that creates hotspots for an imagemap in a asp page. It has the function to place rect, circle, and polygon(I.E. COORDS="639, 161, 671, 129, 699, 160, 669, 190") hotspot shapes. Another function on my mapping tool increases/decreases the sizes of the hotspots. This function is easy with rects and circles(increase radius or add/subtract the points on the rect), but I'm having an issue the polygon translation. I didn't want to instance the drawing class and have to convert to a in memory polygon object and translate back to a the coords... So, question is... anyone know the math to make this happen quickly? Looking for the quick fix with little overhead for my app.
-
getting XY coords of mouse click from a ImageMap Controlin the click event of a ImageMap control I need to know the x y position of the click relating to the Image(not the window)... Any know of a way?
-
DetailsView control customizingI want some fields the edit/insert Mode in a DetailsView control to be multiline textboxes... There is no apparent option for this... anyone know a quick work around?
-
Rotate array data questionif i have a array string[] myArray = {"Wes","Josh","Dave"}; and i want to rotate the order ever so often programmically what is the best way to do that? The program will know when it wants dave to be first but then wes needs to be second and so forth.
-
Detecting Framework executables and versionsI want to be able to detect .net framework applications and version needed(1.0,1.1,2.0,3.0) applications,executables,and dlls on a PC. Is this possible?
-
Poll : average ASP.NET form dev time?because i like to build whole apps in one page(lots of panels).
-
Calender Control In ASP.NETthe most basic: in the aspx page:
lastyear nextyear
in the code behind:private void Page_Load(object sender, System.EventArgs e) { if(!IsPostBack) Calendar1.SelectedDate = DateTime.Now; } private void LinkButton1_Click(object sender, System.EventArgs e) { Calendar1.SelectedDate = Calendar1.SelectedDate.AddYears(-1); Calendar1.VisibleDate = Calendar1.SelectedDate; } private void LinkButton2_Click(object sender, System.EventArgs e) { Calendar1.SelectedDate = Calendar1.SelectedDate.AddYears(1); Calendar1.VisibleDate = Calendar1.SelectedDate; }
-- modified at 18:31 Tuesday 20th June, 2006 -
execting .bat file.are you programming in a limited xp account? is so then dont. or is this running in a secure NT network? if so... what kind of premissions do you have and what external(things other than your computer) resources are you trying to reach.
-
Deploying SQL .MDF File [modified]emran834 wrote:
My Reomote server (Lunarpages)
probably doesn't use integrated security. Ask there tech support
-
can you help me do ma first web page please ?most likely you have a invalid connection string to your database. make sure your premissions to the db are set correctly.
-
Calender Control In ASP.NETi would format a table around the calendar and place two linkbuttons on either side add have them add/subtract years from the cal object selected date and the onclick of those buttons change the selected date for the cal... sound ok?
-
execting .bat file.using Microsoft.Win32; ... string fileName = "c:\\MYBATFILE.BAT"; string args = "YOUR ARGUMENTS GO HERE"; System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents=true; proc.StartInfo.FileName=fileName; proc.StartInfo.Arguments=args; proc.Start(); proc.WaitForExit(); proc.Close();
-
Windows Service with threading issuesI have an issue with stopping threads in a windows service application I was wondering if anyone can help. let me set it up for you. In a windows service you have to use the OnStart method to initialize your application... but you cannot run any loops or sequence of events that contain loops or the state of the application will be in an "starting" service mode indefinitely. So I start a thread call Maint to handle the application. The application has threee main functions at the moment that interface with WAN file shares and a sql db. I run these parallel each in there own thread(and they dont interact with eachother). so in the OnStart method:
maint Maint = new maint(); maintThread = new Thread(new ThreadStart(Maint.start)); maintThread.Start();
in that start method i call:importassets ia = new importassets(); importThread = new Thread(new ThreadStart(ia.importasset)); importThread.Start(); updatereg ur = new updatereg(); updateThread = new Thread(new ThreadStart(ur.runupdate)); updateThread.Start(); forcelogins fl = new forcelogins(); loginThread = new Thread(new ThreadStart(fl.runlogins)); loginThread.Start(); //This section forces the importThread to restart hourly int startTime = System.Environment.TickCount; int runTime = startTime+3600000; while(true) { int nowTime = System.Environment.TickCount; FAISservice fs = new FAISservice(); if(!fs.isRunning) break; if(runTime < nowTime) { importThread.Abort(); Thread.Sleep(3000); startImport(); runTime = nowTime+3600000; } Thread.Sleep(10000); }
Now, all works fine until the OnStop() method gets called by the service being stopped or restarted. in the OnStop() method i run:isRunning = false; maintThread.Abort(); maint Maint = new maint(); Maint.stop();
and in the stop() method i call:importThread.Abort(); updateThread.Abort(); loginThread.Abort();
Now I'm locked in a "STOPPING" state and i have to kill the process... any clues? also... my above 3 threads start while(true) loops that only BREAK when isRunning=false. -
Keeping the position on the pageif using IE try SmartNavigation = true;
-
Is this a bad way to multithread?Thread[] workerThread = new Thread[someInt]; for(int i = 0; i < someInt; i++) { string keyInfo = someKeyInfo().ToString(); workerThread[i] = new Thread(new ThreadStart(DoSomeWork(keyInfo))); workerThread[i].Start(); } foreach(Thread t in workerThread) { while(t.IsAlive()){} }
-
Expanded Remote Registry Editing IssuesDave Kreskowiak wrote:
Are you running in a domain environment? Does the account you're using have Administrator rights to the remote machine?
Yes. Yes.
-
Expanded Remote Registry Editing IssuesHaving issues find solution in for Remote Registry editing. Yeah i got the remote viewing under control... With remote editing, I can do it with VBscript easy:
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") objReg.SetStringValue HKEY_LOCAL_MACHINE,strPointerKey,strPointerEntry,strPointerValue objReg.CreateKey HKEY_LOCAL_MACHINE,strMyKey
surely .NET can do it. this is what i tried:RegistryKey LM = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,WSID); RegistryKey inventoryKeys = LM.OpenSubKey("SOFTWARE\\CompanyName\\AppName"); inventoryKeys.SetValue("ValueName","Value");
and the error message is: Get REG values: System.UnauthorizedAccessException: Cannot write to the registry key. at Microsoft.Win32.RegistryKey.ValidateState(Boolean needWrite) at Microsoft.Win32.RegistryKey.SetValue(String name, Object value) at testReg.Class1.update() in c:\projects\testreg\class1.cs:line 48: 03/24/20 06 02:41:01 PM -
Remote Registry editing?Yeah i got the remote viewing under control... With remote editing, I can do it with VBscript easy:
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") objReg.SetStringValue HKEY_LOCAL_MACHINE,strPointerKey,strPointerEntry,strPointerValue objReg.CreateKey HKEY_LOCAL_MACHINE,strMyKey
surely .NET can do it. this is what i tried:RegistryKey LM = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,WSID); RegistryKey inventoryKeys = LM.OpenSubKey("SOFTWARE\\CompanyName\\AppName"); inventoryKeys.SetValue("ValueName","Value");
and the error message is: Get REG values: System.UnauthorizedAccessException: Cannot write to the registry key. at Microsoft.Win32.RegistryKey.ValidateState(Boolean needWrite) at Microsoft.Win32.RegistryKey.SetValue(String name, Object value) at testReg.Class1.update() in c:\projects\testreg\class1.cs:line 48: 03/24/20 06 02:41:01 PM -- modified at 14:58 Friday 24th March, 2006