July 2008 | Coding Addict [PDF]

Jul 25, 2008 - Sedangkan mereka yang berfokus pada hasil, boleh jadi upaya-upaya terpuji akan dike sampingkan demi merai

33 downloads 48 Views 1MB Size

Recommend Stories


July 2008 News Letter
I want to sing like the birds sing, not worrying about who hears or what they think. Rumi

Thursday July 24, 2008
Nothing in nature is unbeautiful. Alfred, Lord Tennyson

Mahnama ashrafia mubarakpur july 2008 Urdu Islamic pdf Books ... [PDF]
Oct 1, 2015 - Syed Ahmed Shaheed aur Shah ismail Shaheed Urdu Pdf book by Ehsan ullah ,Azadai e Hindostan ,Angreez k agent ,sir syed ahmed khan ki shahadat ... Download urdu pdf books. ANWAAR_US_SAWANEH.pdf download 847.5K ... فوز المقال فÛ

Sex addict
You often feel tired, not because you've done too much, but because you've done too little of what sparks

who is an addict
Do not seek to follow in the footsteps of the wise. Seek what they sought. Matsuo Basho

MedDRA Coding Basics [PDF]
Obtain clarification of data. • Can be optimized by careful design of data ll ti f d. t i i. f t ff collection forms and proper training of staff. • Organizations' coding guidelines should be consistent with MTS:PTC. • Review of term selection

2008 PDF
You miss 100% of the shots you don’t take. Wayne Gretzky

2008 (PDF)
The best time to plant a tree was 20 years ago. The second best time is now. Chinese Proverb

MedDRA Coding Basics [PDF]
Obtain clarification of data. • Can be optimized by careful design of data ll ti f d. t i i. f t ff collection forms and proper training of staff. • Organizations' coding guidelines should be consistent with MTS:PTC. • Review of term selection

2008 [PDF]
Don't ruin a good today by thinking about a bad yesterday. Let it go. Anonymous

Idea Transcript


Coding Addict Some people think that make a program work is just technical issues, logics, mathematics, and to memorize the number of instructions. Sometimes in fact they think that this is just a typing job, whereas thinking deeply. They forget that right-brain work there. Sorry guys, it's not (only) about money, because it's about sense of life.

Friday, July 25, 2008

man jadda wajada bocahK3lana

SISTEM ANTRIAN NASABAH

View my complete profile

Posting pada blog ini adalah versi software yang lama, silahkan kunjungi www.darigarasi.com untuk versi sistem antrian terbaru. SISTEM ANTRIAN NASABAH Version: 2008.1

Newest Links wikimatrix.org

Sistem Antrian Nasabah version 2008.1 terdiri dari dua program:

Open Source For You

- SAN Server

Al Quran dan Terjemahannya

Program yang berfungsi sebagai server antrian dan display antrian untuk nasabah

- SAN Client



Program yang berfungsi sebagai client antrian yang dioperasikan di client workstation

Kebutuhan sistem untuk SAN Server :

Search

- PC Pentium I atau yang lebih tinggi - RAM 128 atau yang lebih tinggi - OS Windows 98/2000/2003/XP/Vista

Web

Golek Upo

Contact me

Kebutuhan hardware : - Printer Antrian (Auto Cut/Receipt Printer) - Audio/Sound System (optional) - Video Converter (optional) - Layar monitor besar untuk nasabah (optional) - Display 7 Segment (5 Digit) untuk tampilan nomor antrian di masing-masing Loket (optional)

Blog Archive 2016 (1) 2015 (2)

Kebutuhan sistem untuk SAN Client : - PC Pentium I atau yang lebih tinggi - RAM 128 atau yang lebih tinggi - OS Windows 98/2000/2003/XP/Vista Optional maksudnya adalah hardware tersebut bisa dipakai bisa juga tidak perlu, tergantung kebutuhan di lapangan.

Features SAN 2008 :

2014 (3) 2013 (6) 2012 (8) 2011 (26) 2010 (8) 2009 (40)

1. Double sistem antrian Dengan demikian dalam satu display Server Antrian bisa melayani 2 macam jenis antrian yang berbeda (lihat gambar). Settingan ini sifatnya optional, jika memerlukan 2 antrian. Tetapi jika tidak diperlukan bisa di nonaktifkan sehingga cukup 1 antrian saja yang akan ditampilkan.

t 2008 (167) December (22) November (4) October (5) September (57)

2. Double banner yaitu vertikal dan horizontal untuk menampilkan banyak informasi yang berbeda dalam satu layar

August (14) t July (14)

3. Display video untuk menampilkan rekaman iklan dll

SISTEM ANTRIAN NASABAH Software Copy Protection

4. Jumlah maksimum client antrian adalah 15 Client (Expandable/Request on Demand) untuk Full Version. Untuk yang Trial Version (Demo) maksimum 3 Client.

Sending information between forms/programs

5. Beroperasi dalam jaringan TCP/IP

Penghasilan dan Rezeki Linux Based Firewall Membaca isi /> but the above syntax is only for "IIS Authenticated Account or User" if we want to implement impersonate for Specific user for all the Request then type the following in web.config file

in our case, we are using Specific user for all request so we are entering username as a "IUSR_WEBSERVER" and password we can also implement Impersonate using Code, but I am not describing this here, you can check the Full Details about "How to Implement Impersonate through code" by click on this link http://support.microsoft.com/kb/306158 To access network file we can not map network drive and use it, but instead of map network drive, we have to use UNC (Universal Naming Convention) So use like this:"\\Fileserver\FolderName\Files\File1.txt" Instead of z:\Folder\Files\file1.txt Here is code to retrieve network file and display on web page. Dim strPath As String = "file://FILESERVER/TempFolder/FileName.pdf">\\FILESERVER\TempFolder\FileName.p df If FileIO.FileSystem.FileExists(Trim(strPath)) Then Response.WriteFile((strappath)) Else 'Show message " File not found" End If Conclusion

So by using this article we can access network files and folder, there are also other way to implement this, but this is depend on users choice. Hope this article will help you.... In case of any Problem or Issues , please feel free to post message.

at 3:01 PM

0 Comments



Link to this post

How to access shared folder or network resource in ASP.Net Source: http://support.microsoft.com/kb/842789

You receive a "logon failure: unknown user name or bad" error message while accessing remote security-enhanced resources from an ASP.NET application SUMMARY

This article discusses the behavior of accessing a remote security-enhanced resource from a Microsoft ASP.NET application. The article contains the following workarounds for this behavior: •

In the Machine.config file, change the userName attribute and the password attribute of the processModel element.



Run the application under the identity of a user who has permissions to the remote security-enhanced resource by using the impersonation element in the Web.config file.



Change the password of the ASPNET user account to some known value, and then create the same ASPNET user account that uses the same password on the remote computer.

Access the remote security-enhanced resource by using a COM component that is running • under the security context of a user account that has permissions to the remote securityenhanced resource. •

Run the part of the code that is accessing the remote security-enhanced resource under the identity of a user who has permissions to the remote security-enhanced resource.

Call the WNetAddConnection2 function to open the connection to the remote security• enhanced resource, and then map the local drive to the remote security-enhanced resource in the code. This article also includes detailed steps to reproduce the behavior. Back to the top SYMPTOMS

When you access remote security-enhanced resources from an ASP.NET application, you may receive the following error message: Logon failure: unknown user name or bad password. Back to the top CAUSE

By default, an ASP.NET application runs under the security context of an ASPNET user account. The ASP.NET application accesses the remote security-enhanced resource by using the ASPNET user account when the following conditions are true: • When the impersonation feature is not turned on for the ASP.NET application •

When the authentication method in Microsoft Internet Information Services (IIS) is set to anonymous access

However, the ASPNET user account may not have permissions to access the remote securityenhanced resource. Back to the top WORKAROUND

To work around this behavior, use one of the following methods: • Use the Machine.config file • Use the impersonation feature in the Web.config file • Change the password of the ASPNET user account • Use a COM component to access the remote security-enhanced resource • Use the code impersonation feature • Call the WNetAddConnection2 function in your code Back to the top

Use the Machine.config file Change the userName attribute and the password attribute in the processModel element of the Machine.config file to the credentials of a user who has access to the remote securityenhanced resource. After you make this change, restart the computer. Note and are placeholders for the credentials of a user who has access to the remote security-enhanced resource. Important Do not to store clear-text passwords in the Machine.config file. Instead, use the Aspnet_setreg.exe utility to store encrypted passwords in the registry. For additional information about how to use the Aspnet_setreg utility, click the following article number to view the article in the Microsoft Knowledge Base: 329290 (http://support.microsoft.com/kb/329290/) How to use the ASP.NET utility to encrypt credentials and session state connection strings When you use this method, the change is global. This is a drawback because other Web applications and other Web services that are running on the computer where you make the change will also run in this new security context. However, this is not the case for Microsoft Internet Information Services (IIS) 6.0 on Microsoft Windows Server 2003 because IIS uses application pools for Web applications and for Web services. Each application can run in its own application pool. Each application pool can be configured for the user name field and the password field. You can set this configuration under the security context of the worker process in the application pool where the application runs. If you change the user account under the security context that the ASP.NET worker process is running in, you may also have to grant the correct permissions to that user account on some folders on the Web server to make the worker process run successfully. For more information about how to create a custom account to run ASP.NET applications, visit the following Microsoft Developer Network (MSDN) Web site: http://msdn2.microsoft.com/en-us/library/aa302396.aspx (http://msdn2.microsoft.com/enus/library/aa302396.aspx) Back to the top

Use the impersonation feature in the Web.config file You can set fixed identities that have access to the remote security-enhanced resource for specific virtual directories by using the following setting in the Web.config file for your application. Note and are placeholders for the credentials of a user who has access to the remote security-enhanced resource. Important Do not to store clear-text passwords in the Machine.config file. Instead, use the Aspnet_setreg.exe utility to store encrypted passwords in the registry. For additional information about how to use the Aspnet_setreg utility, click the following article number to view the article in the Microsoft Knowledge Base: 329290 (http://support.microsoft.com/kb/329290/) How to use the ASP.NET utility to encrypt credentials and session state connection strings You can use one of the following accounts for impersonation: • A domain account • A "mirrored" local account A "mirrored" local account has a matching user name and a matching password on two computers. You must use this account if the computers are in separate domains and do not have a trust relationship.

Back to the top

Change the password of the ASPNET user account By default, the ASP.NET worker process (Aspnet_wp.exe) runs under the ASPNET user account. The ASPNET user account is located under Local Users and Groups. This account has a strong password that is secured in the Local System Authority (LSA). To use this method, follow these steps: 1 In Local Users and Groups on the Web server, change the ASPNET account password to . a known value. Replace the credentials in the processModel element in the Machine.config file with the following. Note is the placeholder for the password that you have assigned to the ASPNET user account. 3 On the remote computer, create an account that is named ASPNET and that has the same . password as the ASPNET user account on the Web server. 4 Add the ASPNET account on the remote computer to the Access Control List (ACL) of . the security-enhanced resource. Back to the top

Use a COM component to access the remote security-enhanced resource Create an ActiveX component: a. Start Microsoft Visual Basic 6.0. b. Create an ActiveX Dll project. c. On the Project menu, click References. The References dialog box appears. d. Click to select the Microsoft Scripting Runtime check box in the Available References list box to add the reference in your project. e. Click OK. f. Press CTRL+R to open Project Explorer, click Project1, and then press F4 to access the properties for the project. g. Change the Name property to remoteAccess. h. In Project Explorer, click Class1.cls, and then change the Name property to clsRemoteAccess. i. On the File menu, click Save Project. The Save File As dialog box appears. j. Save the class file as clsRemoteAccess.cls. k. Save the project file as remoteAccess.vbp. Paste the following code in the code window of the clsRemoteAccess class: Public fs As New FileSystemObject Public txtStream As TextStream 1 ' . Public Function WriteToFile() As Boolean On Error GoTo Erro Set txtStream = fs.OpenTextFile("\\\\", ForAppending, False) ' l. txtStream.WriteLine ("Hi i am able to write") txtStream.Close WriteToFile = True Exit Function Erro: WriteToFile = False End Function Note , , and are placeholders for these values in your environment. m On the File menu, click Make remoteAccess.dll. The Make Project dialog box appears. . n. Click OK. o. On the File menu, click Exit. The Microsoft Visual Basic dialog box appears. p. Click Yes. Create a COM+ application: a On a computer that is running the Microsoft Windows 2000 Advance Server operating system, click Start, point to Programs, point to Administrative . Tools, and then click Component Services. The Component Services dialog box appears. b Expand Component Services, expand Computers, expand My Computer, and then click COM+ Applications. . c Right-click COM+ Applications, click New, and then click Application. The Welcome to the COM Application Install Wizard wizard appears. . d Click Next. . e 2 . Click Create an empty application. . f In the Enter a name for the new application box, type remoteComponent, and then click Next. . g Click This user. . h In the User box, type the name of a user who has access to the remote security-enhanced resource. . i. In the Password box, type the password for the user account. j. In the Confirm password box, type the password again. k Click Next, and then click Finish. . Add the ActiveX component to the COM+ application: a. In the left pane of the Component Services dialog box, expand COM+ Applications, expand remoteComponent, and then click Components. b. Right-click Components, point to New, and then click Component. The Welcome to the COM Component Install Wizard wizard appears.

3 c. Click Next. . d. Click Install new component(s).

e. Locate the remoteAccess.dll file that you created in step 1. f. Click Open, click Next, and then click Finish. This step installs the dynamic link library (DLL) in the COM+ application. Use the COM component in the ASP.NET application: a. Start Microsoft Visual Studio .NET. b. On the File menu, point to New, and then click Project. The New Project dialog box appears. c. Under Project Types, click Visual Basic Projects. d. Under Templates, click ASP.NET Web Application, and then click OK. e. In Solution Explorer, right-click References, and then click Add Reference. The Add Reference dialog box appears. f. Click the COM tab. g. In the Component Name column, click remoteAccess. h. Click Select, and then click OK. i. In Solution Explorer, right-click the WebForm1.aspx file, and then click View Code. Paste the following code at the top of the WebForm1.aspx.vb file. j.

Imports remoteAccess

4 . k. Locate the Page_Load method. Paste the following code in the Page_Load method. Dim objRemoteAccess As New clsRemoteAccessClass Dim blnWriteResult As Boolean ' blnWriteResult = objRemoteAccess.WriteToFile() l. ' If (blnWriteResult) Then Response.Write("Success") Else Response.Write("Failed") End If m. On the Build menu, click Build Solution. n. On the Debug menu, click Start. You receive the success message in the browser. Back to the top

Use the code impersonation feature By default, the ASP.NET worker process (Aspnet_wp.exe) runs under the security context of the ASPNET user account. To use this method, the user account under the security context that the ASP.NET worker process (Aspnet_wp.exe) runs in must be part of the "Act as part of the operating system" policy. You can use Local Security Policy in the Windows Administrative Tools to add the ASPNET user account to the "Act as part of the operating system" policy. Note To use this method, you must maintain a list of user names and their corresponding passwords in your application. Because you are using those user names and passwords to connect to the remote security-enhanced resources from the code, you must make changes in your application when these user names or their corresponding passwords change. 1 Start Microsoft Visual Studio .NET . 2 On the File menu, point to New, and then click Project. The New Project dialog box appears. . 3 Select Visual Basic Projects under Project Types. . 4 Select ASP.NET Web Application under Templates. . 5 Click OK. . 6 Right-click the WebForm1.aspx file in the solution explorer window, and then click View Code. . Add the following code at the top of the WebForm1.aspx.vb file. 7 Imports System.IO . Imports System.Security Imports System.Security.Principal Locate the Public Class WebForm1 Inherits System.Web.UI.Page statement and then add the following code after the Public Class WebForm1 Inherits System.Web.UI.Page statement. Dim LOGON32_LOGON_INTERACTIVE As Integer = 2 Dim LOGON32_PROVIDER_DEFAULT As Integer = 0 ' Declare Function LogonUserA Lib "advapi32.dll" (ByVal lpxzUsername As String, _ ByVal lpszDomain As String, _ ByVal lpszpassword As String, _ ByVal dwLogonType As Integer, _ 8 ByVal dwLogonProvider As Integer, _ . ByRef phToken As IntPtr) As Integer Declare Auto Function DuplicateToken Lib "advapi32.dll" ( _ ByVal ExistingTokenHandle As IntPtr, _ ByVal ImpersonationLevel As Integer, _ ByRef DuplicateTokenHandle As IntPtr) As Integer Declare Auto Function RevertToSelf Lib "advapi32.dll" () As Long ' Declare Auto Function CloseHandle Lib "Kernel32.dll" (ByVal handle As IntPtr) As Long ' Dim impersonationContext As WindowsImpersonationContext Locate the Page_Load method, and then paste the following code in the Page_Load method. Try If impersonateValidUser("", "", "") Then Dim fs As New FileStream("\\\\", FileMode.Append) Dim w As New StreamWriter(fs) Try w.Write(w.NewLine) w.WriteLine("Hi how are you") w.Close() fs.Close() Catch w.Close() fs.Close() 9 End Try . ' undoImpersonation() Response.Write("Success") Else Response.Write("Failure") End If Catch ex As Exception Response.Write(ex.Message) Response.Write(vbNewLine & User.Identity.Name) Response.Write(vbNewLine) Response.Write(vbNewLine & Principal.WindowsIdentity.GetCurrent.Name) End Try Note , , , , and are placeholders for these values in your environment. and are the values for the credential of the user who has access to the file on the remote computer. Locate the End Sub statement and then paste the following code after the End Sub statement. ' Private Function impersonateValidUser(ByVal userName As String, _ ByVal domain As String, ByVal password As String) As Boolean Dim tempWindowsIdentity As WindowsIdentity Dim token As IntPtr = IntPtr.Zero Dim tokenDuplicate As IntPtr = IntPtr.Zero impersonateValidUser = False ' If RevertToSelf() Then If LogonUserA(userName, domain, password, LOGON32_LOGON_INTERACTIVE, _ LOGON32_PROVIDER_DEFAULT, token) 0 Then If DuplicateToken(token, 2, tokenDuplicate) 0 Then tempWindowsIdentity = New WindowsIdentity(tokenDuplicate) impersonationContext = tempWindowsIdentity.Impersonate() If Not impersonationContext Is Nothing Then 1 impersonateValidUser = True 0 End If . End If End If End If ' If Not tokenDuplicate.Equals(IntPtr.Zero) Then CloseHandle(tokenDuplicate) End If ' If Not token.Equals(IntPtr.Zero) Then CloseHandle(token) End If ' End Function ' Private Sub undoImpersonation() impersonationContext.Undo() End Sub 1 1 On the Build menu, click Build Solution. . 1 2 On the Debug menu, click Start. You receive the success message in the browser. . Note To use this method, you must maintain a list of user names and their corresponding passwords in your application. Because you are using those user names and passwords to connect to the remote security-enhanced resources from the code, you must make changes in your application when these user names or their corresponding passwords change.

Back to the top

Call the WNetAddConnection2 function in your code To use this method, you must call the WNetAddConnection2 function. The WNetAddConnection2 function makes a connection to a network resource. The function can redirect a local device to the network resource. Note To use this method, you must maintain a list of user names and their corresponding passwords in your application. Because you are using those user names and passwords to connect to the remote security-enhanced resources from the code, you must make changes in your application when these user names or their corresponding passwords change. 1 Start Microsoft Visual Studio .NET . 2 On the File menu, point to New, and then click Project. The New Project dialog box appears. . 3 Under Project Types, click Visual Basic Projects. . 4 Under Templates, click ASP.NET Web Application, and then click OK. . 5 In Solution Explorer, right-click the WebForm1.aspx file, and then click View Code. . Add the following code at the top of the WebForm1.aspx.vb file. 6 Imports System.IO . Imports System.Runtime.InteropServices Add the following code after the Public Class WebForm1 Inherits System.Web.UI.Page statement.

' Structure NETRESOURCE Public dwScope As Int32 Public dwType As Int32 Public dwDisplayType As Int32 Public dwUsage As Int32 Public lpLocalName As String Public lpRemoteName As String Public lpComment As String Public lpProvider As String End Structure 7 ' . Public Const NO_ERROR As Int32 = 0 Public Const CONNECT_UPDATE_PROFILE As Int32 = &H1 Public Const RESOURCETYPE_DISK As Int32 = &H1 ' Declare Function WNetAddConnection2 Lib "mpr.dll" Alias _ "WNetAddConnection2A" (ByRef lpNetResource As NETRESOURCE, _ ByVal lpPassword As String, ByVal lpUserName ByVal dwFlags As Int32) As Int32 ' Declare Function WNetCancelConnection2 Lib "mpr.dll" Alias _ "WNetCancelConnection2A" (ByVal lpName As String, _ ByVal dwFlags As Long, ByVal fForce As Long) As Long 8 Locate the Page_Load method. . Paste the following code in the Page_Load method. Try ' Dim Result As Long Dim theNetResource As NETRESOURCE theNetResource.dwType = RESOURCETYPE_DISK theNetResource.lpRemoteName = "\\\" theNetResource.lpLocalName = "X:" ' Result = WNetAddConnection2(theNetResource, "", "", CONNECT_UPDATE_PROFILE) ' If (Result = NO_ERROR) Then ' Dim fs As New FileStream("X:\", FileMode.Append) Dim w As New StreamWriter(fs) ' Try w.Write(w.NewLine) w.WriteLine("Hi how are you") 9 w.Close() . fs.Close() Response.Write("Success") Catch Response.Write("Failed") w.Close() fs.Close() End Try ' Else Response.Write("Failed") End If ' Result = WNetCancelConnection2(theNetResource.lpLocalName, 0, 0) ' Catch ' End Try '

Note , , , , and are placeholders for these values in your environment. and

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.