Search Results

Search found 168 results on 7 pages for 'derrick miller'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • reading non-english html pages with c#

    - by Gal Miller
    I am trying to find a string in Hebrew in a website. The reading code is attached. Afterward I try to read the file using streamReader but I can't match strings in other languages. what am I suppose to do? // used on each read operation byte[] buf = new byte[8192]; // prepare the web page we will be asking for HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http://www.webPage.co.il"); // execute the request HttpWebResponse response = (HttpWebResponse) request.GetResponse(); // we will read data via the response stream Stream resStream = response.GetResponseStream(); string tempString = null; int count = 0; FileStream fileDump = new FileStream(@"c:\dump.txt", FileMode.Create); do { count = resStream.Read(buf, 0, buf.Length); fileDump.Write(buf, 0, buf.Length); } while (count > 0); // any more data to read? fileDump.Close();

    Read the article

  • Do you use Scimore SQL database ?

    - by Darian Miller
    There's a database engine that looks amazing for a free tool and that is Scimore. Have you had much experience with it? If so, how does it rate..particularly against Firebird? How resilient/self reliant is it? (Meaning how much downtime/maintenance is expected?) The scale out capabilities also look very interesting. I just downloaded it and have been playing around and so far it looks good. I had been looking for an easy to deploy single-user type embedded database (which Scimore has an option) and was toying with MS SQL Compact Edition and SQLite and remembered this database from a trial a few years ago. (Windows platform) I was about ready to settle in on SQLite but started thinking about other projects which are multi-user and wanted to stick with a single solution...which is why I started looking at Firebird as well.

    Read the article

  • Regex for recursive "wiki-style" lists

    - by Syd Miller
    I'm trying to create a Regular Expression to match "wiki style" lists as in (using preg_replace_callback() ): * List Item 1 * List Item 2 *# List Item 2.1 *# List Item 2.2 * List Item 3 Asterisks denote Unordered Lists while Number-Signs denote Ordered Lists. I'm trying to get this so it can match infinite depth and so that * and # can be mixed. I tried the following expression (and variations of it): /\s([*#]{1,}) ([\S ]+)\s/si But it doesn't seem to want to work. What am I doing wrong? Or is there a better way of accomplishing this?

    Read the article

  • Suggestions for VS+Resharper keyboard shortcuts on a Mac

    - by John Miller
    I just upgraded to a Macbook Pro as my development machine but still primarily develop .Net applications with Visual Studio and Resharper (via VMWare Fusion). By far, the biggest obstacle I'm running into is getting used to the keyboard layout change (ex. not being able to do ALT-Insert). Do any of you Windows-on-Mac veterans have any suggestions on how to ease the pain of transitioning (without moving to an external keyboard)? Are you changing mappings via VMWare's keyboard preferences? Or are you using something like AutoHotkey? Any other windows development tips for a Mac newb?

    Read the article

  • The conceptual process of populating related tables in a database (MySql) from a CSV file

    - by user322772
    I'm new to relational databases and all the material I've read covered primary and foreign keys, normal forms, and joins but left out to populate the database once it's created. How do you import a CSV file so the fields match their related table? Say you were tying to build a beer database and had a CSV file with each line as a record. Header: brewer, beer_name, country, city, state, beer_category, beer_type, alcohol_content Record 1: Anheuser-Busch, Budweiser, United States, St. Louis, Mo, Pale lager, Regular, 5.0% Record 2: Anheuser-Busch, Bud Light, United States, St. Louis, Mo, Pale lager Light, 4.2% Record 3: Miller Brewing Company, Miller Lite, United States, Milwaukee, WI, Pale lager, Light, 4.2% You can create a "Brewer" table and a "Beer" table. When importing how does you connect the primary keys between the tables?

    Read the article

  • The PROMOTE TRANSACTION request failed because there is no local transaction active.

    - by Mark J Miller
    Under what circumstances would I see the above message? I have a single call to SQL Server which is wrapped in a call to TransactionScope. In our development and QA environments MSDTC is turned off and the call succeeds fine. However, in our production environment with MSDTC turned on we are failing with this call. Is there something that would cause this when I am sure we are not looking at a distributed transaction call at all?

    Read the article

  • Instanciate a class with a given id in ExtJS

    - by Miller
    Hello, I would like to know if it is possible to instanciate a class by its id . For example we have a class extending Ext.grid.GridPanel with an id property, is it possible to instanciate the class just knowing his id (which is the component id in this case) ?

    Read the article

  • Good IM/Chat solution for pasting code

    - by Matt Miller
    We've got several distributed developers working together on a couple of projects. We've been using Skype to host chats with all the developers, and it works okay except for one thing: It REALLY mangles any code we copy and paste into the chats -- especially the whitespace in Python. This question has tons of opinions about chat clients & servers, but no one has much to say about pasting in code. (http://stackoverflow.com/questions/36415/best-chat-im-tool-for-developers) Is anybody out there using a chat or im client that handles source code really well?

    Read the article

  • Reading a C/C++ data structure in C# from a byte array

    - by Chris Miller
    What would be the best way to fill a C# struct from a byte[] array where the data was from a C/C++ struct? The C struct would look something like this (my C is very rusty): typedef OldStuff { CHAR Name[8]; UInt32 User; CHAR Location[8]; UInt32 TimeStamp; UInt32 Sequence; CHAR Tracking[16]; CHAR Filler[12];} And would fill something like this: [StructLayout(LayoutKind.Explicit, Size = 56, Pack = 1)]public struct NewStuff{ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(0)] public string Name; [MarshalAs(UnmanagedType.U4)] [FieldOffset(8)] public uint User; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] [FieldOffset(12)] public string Location; [MarshalAs(UnmanagedType.U4)] [FieldOffset(20)] public uint TimeStamp; [MarshalAs(UnmanagedType.U4)] [FieldOffset(24)] public uint Sequence; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] [FieldOffset(28)] public string Tracking;} What is best way to copy OldStuff to NewStuff, if OldStuff was passed as byte[] array? I'm currently doing something like the following, but it feels kind of clunky. GCHandle handle;NewStuff MyStuff;int BufferSize = Marshal.SizeOf(typeof(NewStuff));byte[] buff = new byte[BufferSize];Array.Copy(SomeByteArray, 0, buff, 0, BufferSize);handle = GCHandle.Alloc(buff, GCHandleType.Pinned);MyStuff = (NewStuff)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(NewStuff));handle.Free(); Is there better way to accomplish this?

    Read the article

  • How to implement wait(); to wait for a notifyAll(); from enter button?

    - by Dakota Miller
    Sorry for the confusion I posted the Worng Logcat info. I updated the question. I want to click Start to start a thread then when enter is clicked i want the thad to continue and get the message and handle the message in the thread then output it to the main thread and update the text view. How would i start a thread to wait for enter to be pressed and get the bundle for the Handler? Here is my Code: public class MainActivity extends Activity implements OnClickListener { Handler mHandler; Button enter; Button start; TextView display; String dateString; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); enter = (Button) findViewById(R.id.enter); start = (Button) findViewById(R.id.start); display = (TextView) findViewById(R.id.Display); enter.setOnClickListener(this); start.setOnClickListener(this); mHandler = new Handler() { <=============================This is Line 31 public void handleMessage(Message msg) { // TODO Auto-generated method stub super.handleMessage(msg); Bundle bundle = msg.getData(); String string = bundle.getString("outKey"); display.setText(string); } }; } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.enter: Message msgin = Message.obtain(); Bundle bundlein = new Bundle(); String in = "It Works!"; bundlein.putString("inKey", in); msgin.setData(bundlein); notifyAll(); break; case R.id.start: new myThread().hello.start(); break; } } public class myThread extends Thread { Thread hello = new Thread() { @Override public void run() { // TODO Auto-generated method stub super.run(); Looper.prepare(); try { wait(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } Handler Mhandler = new Handler() { @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub super.handleMessage(msg); Bundle bundle = msg.getData(); dateString = bundle.getString("inKey"); } }; Looper.loop(); Message msg = Message.obtain(); Bundle bundle = new Bundle(); bundle.putString("outKey", dateString); msg.setData(bundle); mHandler.sendMessage(msg); } }; } } Here is the logcat info: 06-27 00:00:24.832: E/AndroidRuntime(18513): FATAL EXCEPTION: Thread-1210 06-27 00:00:24.832: E/AndroidRuntime(18513): java.lang.IllegalMonitorStateException: object not locked by thread before wait() 06-27 00:00:24.832: E/AndroidRuntime(18513): at java.lang.Object.wait(Native Method) 06-27 00:00:24.832: E/AndroidRuntime(18513): at java.lang.Object.wait(Object.java:364) 06-27 00:00:24.832: E/AndroidRuntime(18513): at com .example.learninghandlers.MainActivity$myThread$1.run(MainActivity.java:77)

    Read the article

  • Boost Filesystem Library Visual C++ Compile Error

    - by John Miller
    I'm having the following issue just trying to compile/run some of the example programs with the Boost Filesystem Library. I'm using MS-Visual C++ with Visual Studio .NET (2003). I've installed the Boost libraries, version 1.38 and 1.39 (just in case there was a version problem) using the BoostPro installers. If I just try to include /boost/filesystem/operations.hpp I receive the following error: \boost_1_38\boost\system\error_code.hpp(230) : error C2039: 'type' : is not a member of 'boost::enable_if<boost::system::is_error_condition_enum<Cond,boost::detail::enable_if_default_T>' Any help is greatly appreciated. Thank you!

    Read the article

  • How do I query delegation properties of an active directory user account?

    - by Mark J Miller
    I am writing a utility to audit the configuration of a WCF service. In order to properly pass credentials from the client, thru the WCF service back to the SQL back end the domain account used to run the service must be configured in Active Directory with the setting "Trust this user for delegation" (Properties - "Delegation" tab). Using C#, how do I access the settings on this tab in Active Directory. I've spent the last 5 hours trying to track this down on the web and can't seem to find it. Here's what I've done so far: using (Domain domain = Domain.GetCurrentDomain()) { Console.WriteLine(domain.Name); // get domain "dev" from MSSQLSERVER service account DirectoryEntry ouDn = new DirectoryEntry("LDAP://CN=Users,dc=dev,dc=mydomain,dc=lcl"); DirectorySearcher search = new DirectorySearcher(ouDn); // get sAMAccountName "dev.services" from MSSQLSERVER service account search.Filter = "(sAMAccountName=dev.services)"; search.PropertiesToLoad.Add("displayName"); search.PropertiesToLoad.Add("userAccountControl"); SearchResult result = search.FindOne(); if (result != null) { Console.WriteLine(result.Properties["displayName"][0]); DirectoryEntry entry = result.GetDirectoryEntry(); int userAccountControlFlags = (int)entry.Properties["userAccountControl"].Value; if ((userAccountControlFlags & (int)UserAccountControl.TRUSTED_FOR_DELEGATION) == (int)UserAccountControl.TRUSTED_FOR_DELEGATION) Console.WriteLine("TRUSTED_FOR_DELEGATION"); else if ((userAccountControlFlags & (int)UserAccountControl.TRUSTED_TO_AUTH_FOR_DELEGATION) == (int)UserAccountControl.TRUSTED_TO_AUTH_FOR_DELEGATION) Console.WriteLine("TRUSTED_TO_AUTH_FOR_DELEGATION"); else if ((userAccountControlFlags & (int)UserAccountControl.NOT_DELEGATED) == (int)UserAccountControl.NOT_DELEGATED) Console.WriteLine("NOT_DELEGATED"); foreach (PropertyValueCollection pvc in entry.Properties) { Console.WriteLine(pvc.PropertyName); for (int i = 0; i < pvc.Count; i++) { Console.WriteLine("\t{0}", pvc[i]); } } } } The "userAccountControl" does not seem to be the correct property. I think it is tied to the "Account Options" section on the "Account" tab, which is not what we're looking for but this is the closest I've gotten so far. The justification for all this is: We do not have permission to setup the service in QA or in Production, so along with our written instructions (which are notoriously only followed in partial) I am creating a tool that will audit the setup (WCF and SQL) to determine if the setup is correct. This will allow the person deploying the service to run this utility and verify everything is setup correctly - saving us hours of headaches and reducing downtime during deployment.

    Read the article

  • Question about unions and heap allocated memory

    - by Dennis Miller
    I was trying to use a union to so I could update the fields in one thread and then read allfields in another thread. In the actual system, I have mutexes to make sure everything is safe. The problem is with fieldB, before I had to change it fieldB was declared like field A and C. However, due to a third party driver, fieldB must be alligned with page boundary. When I changed field B to be allocated with valloc, I run into problems. Questions: 1) Is there a way to statically declare fieldB alligned on page boundary. Basically do the same thing as valloc, but on the stack? 2) Is it possible to do a union when field B, or any field is being allocated on the heap?. Not sure if that is even legal. Here's a simple Test program I was experimenting with. This doesn't work unless you declare fieldB like field A and C, and make the obvious changes in the public methods. #include <iostream> #include <stdlib.h> #include <string.h> #include <stdio.h> class Test { public: Test(void) { // field B must be alligned to page boundary // Is there a way to do this on the stack??? this->field.fieldB = (unsigned char*) valloc(10); }; //I know this is bad, this class is being treated like //a global structure. Its self contained in another class. unsigned char* PointerToFieldA(void) { return &this->field.fieldA[0]; } unsigned char* PointerToFieldB(void) { return this->field.fieldB; } unsigned char* PointerToFieldC(void) { return &this->field.fieldC[0]; } unsigned char* PointerToAllFields(void) { return &this->allFields[0]; } private: // Is this union possible with field B being // allocated on the heap? union { struct { unsigned char fieldA[10]; //This field has to be alligned to page boundary //Is there way to be declared on the stack unsigned char* fieldB; unsigned char fieldC[10]; } field; unsigned char allFields[30]; }; }; int main() { Test test; strncpy((char*) test.PointerToFieldA(), "0123456789", 10); strncpy((char*) test.PointerToFieldB(), "1234567890", 10); strncpy((char*) test.PointerToFieldC(), "2345678901", 10); char dummy[11]; dummy[10] = '\0'; strncpy(dummy, (char*) test.PointerToFieldA(), 10); printf("%s\n", dummy); strncpy(dummy, (char*) test.PointerToFieldB(), 10); printf("%s\n", dummy); strncpy(dummy, (char*) test.PointerToFieldC(), 10); printf("%s\n", dummy); char allFields[31]; allFields[30] = '\0'; strncpy(allFields, (char*) test.PointerToAllFields(), 30); printf("%s\n", allFields); return 0; }

    Read the article

  • visual analysis of web pages in ruby

    - by Clint Miller
    I'm looking to write some code that does visual analysis of web pages, preferably using Ruby. My code will need to be able to determine the top, left, width, height, background color, color, and font size for all the elements in the DOM. Of course, these values can only be calculated once all CSS is applied. So, I don't think that Nokogiri is up for the job. Ultimately, I'm trying to use this data in a VIPS-like (Vision-Based Page Segmentation) algorithm in an attempt to find the main content in downloaded news articles. I've considered using Watir to drive Chrome or Firefox and then extract the data. The problem is that browsers can't be run headless through Watir (I think). Ultimately, this code will be running on an array of Linux servers in a data center. So, the code won't have easy access to an X Server for displaying the browser. I suppose one solution is to use Watir and run a headless X Server on the Linux servers. That's a bit of a pain, but it looks like my best option right now. Does anyone have any better ideas?

    Read the article

  • C++ OOP - Can you 'overload a cast' <- hard to explain in 1 sentence

    - by Brandon Miller
    Well, the WinAPI has a POINT struct, but I am trying to make an alternative class to this so you can set the values of x and y from a constructor. /** * X-Y coordinates */ class Point { public: int X, Y; Point(void) : X(0), Y(0) {} Point(int x, int y) : X(x), Y(y) {} Point(const POINT& pt) : X(pt.x), Y(pt.y) {} Point& operator= (const POINT& other) { X = other.x; Y = other.y; } }; // I have an assignment operator and copy constructor. Point myPtA(3,7); Point myPtB(8,5); POINT pt; pt.x = 9; pt.y = 2; // I can assign a 'POINT' to a 'Point' myPtA = pt; // But I also want to be able to assign a 'Point' to a 'POINT' pt = myPtB; Is it possible to overload operator= in a way so that I can assign a Point to a POINT? Or maybe some other method to achieve this? Thanks in advance.

    Read the article

  • jQuery: preventdefault does not work

    - by Kent Miller
    I somehow cannot achieve that the a-tag looses its default action when clicking it: <a href="#" class="button dismiss">dismiss</a> $(document).ready(function() { $('.dismiss').click(function(e) { e.preventDefault(); $('#output').empty(); $('#MyUploadForm .button').show(); }); }); When I click the button, the browser window scrolls to the top. What is wrong here?

    Read the article

  • How to get a collection of divs with jquery?

    - by Gal Miller
    I want to get the second img: <form id="formElem" name="formElem" action="" method="post"> <fieldset class="step"> <img src="1.jpg" > </fieldset> <fieldset class="step"> <img src="2.jpg" > </fieldset> <fieldset class="step"> <img src="3.jpg" > </fieldset> </form> I tried doing something like: var imgSRC = $("div[id ='step']").get(1).find('img').attr('src'); alert(imgSRC); Got nothing....

    Read the article

  • Split string on first two colons

    - by Mark Miller
    I would like to split a column of strings on the first two colons, but not on any subsequent colons: my.data <- read.table(text=' my.string some.data 12:34:56:78 -100 87:65:43:21 -200 a4:b6:c8888 -300 11:bb:ccccc -400 uu:vv:ww:xx -500', header = TRUE) desired.result <- read.table(text=' my.string1 my.string2 my.string3 some.data 12 34 56:78 -100 87 65 43:21 -200 a4 b6 c8888 -300 11 bb ccccc -400 uu vv ww:xx -500', header = TRUE) I have searched extensively and the following question is the closest to my current dilemma: Split on first comma in string Thank you for any suggestions. I prefer to use base R.

    Read the article

  • Silverlight Cream for March 11, 2010 -- #812

    - by Dave Campbell
    In this Issue: Walter Ferrari, Viktor Larsson, Bill Reiss(-2-, -3-, -4-), Jonathan van de Veen, Walt Ritscher, Jobi Joy, Pete Brown, Mike Taulty, and Mark Miller. Shoutouts: Going to MIX10? John Papa announced Got Questions? Ask the Experts at MIX10 Pete Brown listed The Essential WPF/Silverlight/XNA Developer and Designer Toolbox From SilverlightCream.com: How to extend Bing Maps Silverlight with an elevation profile graph - Part 2 In this second and final tutorial, Walter Ferrari adds elevation to his previous BingMaps post. I'm glad someone else worked this out for me :) Navigating AWAY from your Silverlight page Viktor Larsson has a post up on how to navigate to something other than your Silverlight page like maybe a mailto ... SilverSprite: Not just for XNA games any more Bill Reiss has a new version of SilverSprite up on CodePlex and if you're planning on doing any game development, you should check this out for sure Space Rocks game step 1: The game loop Bill Reiss has a tutorial series on Game development that he's beginning ... looks like a good thing to jump in on and play along. This first one is all about the game loop. Space Rocks game step 2: Sprites (part 1) In Part 2, Bill Reiss begins a series on Sprites in game development and positioning it. Space Rocks game step 3: Sprites (part 2) Bill Reiss's Part 3 is a follow-on tutorial on Sprites and moving according to velocity... fun stuff :) Adventures while building a Silverlight Enterprise application part No. 32 Jonathan van de Veen is discussing debugging and the evil you can get yourself wrapped up in... his scenario is definitely one to remember. Streaming Silverlight media from a Dropbox.com account Read the comments and the agreements, but I think Walt Ritscher's idea of using DropBox to serve up Streaming media is pretty cool! UniformGrid for Silverlight Jobi Joy wanted a UniformGrid like he's familiar with in WPF. Not finding one in the SDK or Toolkit, he converted the WPF one to Silverlight .. all good for you and me :) How to Get Started in WPF or Silverlight: A Learning Path for New Developers Pete Brown has a nice post up describing resources, tutorials, blogs, and books for devs just getting into Silveright or WPF, and thanks for the shoutout, Pete! Silverlight 4, MEF and the DeploymentCatalog ( again :-) ) Mike Taulty is revisiting the DeploymentCatalog to wrap it up in a class like he did the PackageCatalog previously MVVM with Prism 101 – Part 6b: Wrapping IClientChannel Mark Miller is back with a Part 6b on MVVM with Prism, and is answering some questions from the previous post and states his case against the client service proxy. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    MIX10

    Read the article

  • The Latest Dish: Black Eyed Peas to Headline at Appreciation Event

    - by Justin Kestelyn
    If you're coming to Oracle Develop Conference to fill up on content, collaboration, and community, be sure to save room for dessert. At the Wednesday evening "Appreciation Event," which is open to Oracle Develop, JavaOne, and Oracle OpenWorld Full Conference attendees, you'll be savoring the music of the world's hottest funk pop band, Black Eyed Peas, plus superstar rock legends Don Henley (of the Eagles) and Steve Miller. Save the date now: When: Wednesday, September 22, 8 p.m.­12 a.m. Where: Treasure Island, San Francisco Get all the details here!

    Read the article

  • Encrypting your SQL Server Passwords in Powershell

    - by laerte
    A couple of months ago, a friend of mine who is now bewitched by the seemingly supernatural abilities of Powershell (+1 for the team) asked me what, initially, appeared to be a trivial question: "Laerte, I do not have the luxury of being able to work with my SQL servers through Windows Authentication, and I need a way to automatically pass my username and password. How would you suggest I do this?" Given that I knew he, like me, was using the SQLPSX modules (an open source project created by Chad Miller; a fantastic library of reusable functions and PowerShell scripts), I merrily replied, "Simply pass the Username and Password in SQLPSX functions". He rather pointed responded: "My friend, I might as well pass: Username-'Me'-password 'NowEverybodyKnowsMyPassword'" As I do have the pleasure of working with Windows Authentication, I had not really thought this situation though yet (and thank goodness I only revealed my temporary ignorance to a friend, and the embarrassment was minimized). After discussing this puzzle with Chad Miller, he showed me some code for saving passwords on SQL Server Tables, which he had demo'd in his Powershell ETL session at Tampa SQL Saturday (and you can download the scripts from here). The solution seemed to be pretty much ready to go, so I showed it to my Authentication-impoverished friend, only to discover that we were only half-way there: "That's almost what I want, but the details need to be stored in my local txt file, together with the names of the servers that I'll actually use the Powershell scripts on. Something like: Server1,UserName,Password Server2,UserName,Password" I thought about it for just a few milliseconds (Ha! Of course I'm not telling you how long it actually took me, I have to do my own marketing, after all) and the solution was finally ready. First , we have to download Library-StringCripto (with many thanks to Steven Hystad), which is composed of two functions: One for encryption and other for decryption, both of which are used to manage the password. If you want to know more about the library, you can see more details in the help functions. Next, we have to create a txt file with your encrypted passwords:$ServerName = "Server1" $UserName = "Login1" $Password = "Senha1" $PasswordToEncrypt = "YourPassword" $UserNameEncrypt = Write-EncryptedString -inputstring $UserName -Password $PasswordToEncrypt $PasswordEncrypt = Write-EncryptedString -inputstring $Password -Password $PasswordToEncrypt "$($Servername),$($UserNameEncrypt),$($PasswordEncrypt)" | Out-File c:\temp\ServersSecurePassword.txt -Append $ServerName = "Server2" $UserName = "Login2" $Password = "senha2" $PasswordToEncrypt = "YourPassword" $UserNameEncrypt = Write-EncryptedString -inputstring $UserName -Password $PasswordToEncrypt $PasswordEncrypt = Write-EncryptedString -inputstring $Password -Password $PasswordToEncrypt "$($Servername),$($UserNameEncrypt),$($PasswordEncrypt)" | Out-File c:\temp\ ServersSecurePassword.txt -Append .And in the c:\temp\ServersSecurePassword.txt file which we've just created, you will find your Username and Password, all neatly encrypted. Let's take a look at what the txt looks like: .and in case you're wondering, Server names, Usernames and Passwords are all separated by commas. Decryption is actually much more simple:Read-EncryptedString -InputString $EncryptString -password "YourPassword" (Just remember that the Password you're trying to decrypt must be exactly the same as the encrypted phrase.) Finally, just to show you how smooth this solution is, let's say I want to use the Invoke-DBMaint function from SQLPSX to perform a checkdb on a system database: it's just a case of split, decrypt and be happy!Get-Content c:\temp\ServerSecurePassword.txt | foreach { [array] $Split = ($_).split(",") Invoke-DBMaint -server $($Split[0]) -UserName (Read-EncryptedString -InputString $Split[1] -password "YourPassword" ) -Password (Read-EncryptedString -InputString $Split[2] -password "YourPassword" ) -Databases "SYSTEM" -Action "CHECK_DB" -ReportOn c:\Temp } This is why I love Powershell.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >