CSharp

There are 44 entries for the tag CSharp

FourSquare Checkin with CSharp

Here’s how to automatically check-in to FourSquare from C#. Yes, I did cheat with this for about a week. Apparently people were wondering how I was checkin in and defending my mayorships while I was out of the country. Haha. Anyway, here you go: static void Checkin(string venueid, double latitude, double longitude) { string result = HttpPost("http://api.foursq... "vid=" + venueid + "&private=0&geolat=" + Scatter(latitude) + "&geolong=" + Scatter(longitude), "myuser", ......

Posted On Monday, September 27, 2010 12:39 PM | Comments (1)

Test PS Script Formatter

Step three: Paste in the following RSSBus Web Part template, and click "Apply". <rsb:info title="Google Calendar Sync" description="This template Syncs your SharePoint Calendar events with those in a Google Calendar account."> <input name="email" description="The email used to authenticate with Google." required="true"/> <input name="password" description="The password used to authenticate with Google." required="true" style="password"/> <input name="calendar" description="The ......

Posted On Wednesday, January 13, 2010 2:14 PM | Comments (0)

10 DIY SharePoint Web Parts #10

This post is the tenth and last in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #10 - Keep Your SharePoint Calendar Synced with Google The following is one way you can use to keep your SharePoint Calendar(s) synced up with your Google Calendar. This particular example only syncs in one direction: from Google to SharePoint. It could go the opposite direction, ......

Posted On Wednesday, January 13, 2010 1:19 PM | Comments (12)

PowerShell: Twitter Auto UN-follow

Anybody who uses Twitter has heard of auto-follow services for Twitter. Below is a PowerShell script I used to auto UNfollow. The script goes through the people you're following and eliminates "idle" or "spam" friends. An idle friend is determined by a low friend count or low status count on an account that has been in existance for at least a couple months (configurable). A spam friend is determined by a high friend count but a low follower count (by default, the script uses a 15-1 ratio as the ......

Posted On Tuesday, January 12, 2010 1:06 PM | Comments (4)

Listing SPQuery FieldNameRefs

It took me a while to figure out how to get a list of all the available fields for a particular type of list in SharePoint (for performing custom queries in SPQuery). I was looking for a published list of these fields, which as far as I know does not exist. Instead, you just use the GetList method of the Lists SOAP service. Here’s an example SOAP request: <?xml version="1.0" encoding="utf-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://sche... SOAP-ENV:encodingStyle="htt... ......

Posted On Monday, December 7, 2009 4:24 AM | Comments (0)

10 DIY SharePoint Web Parts #9

This post is the ninth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #9 – Microsoft Dynamics CRM The credit for this particular web part template goes to one of my co-workers Shannon Prue. I asked him if he could put together a MS CRM template example for me, and a few minutes later I had in my inbox a 10 line example template! In the past, integrating ......

Posted On Monday, November 9, 2009 10:13 AM | Comments (1)

10 DIY SharePoint Web Parts #8

This post is the eighth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #8 – Twitter Many times since I originally posted about it months ago, I’ve been asked for more details about including Twitter searches and streams inside their SharePoint pages. Thanks to the Twitter API and feeds, this is very simple to do, and to change from showing searches, ......

Posted On Friday, October 30, 2009 3:35 AM | Comments (2)

10 DIY SharePoint Web Parts #7

This post is the seventh in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #7 – Search Email History One of my good friends here recently asked me to give him an easy way to quickly bring up a list of email correspondence to and from a particular email address over the past 6 months. This way, if he is assisting someone on the telephone or email, he can ......

Posted On Wednesday, October 21, 2009 5:07 AM | Comments (0)

10 DIY SharePoint Web Parts #6

This post is the sixth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #6 – Shipment Tracking Web Part! I’ve been holding on to this one for a while. Until recently it was just a FedEx shipment tracker, but now the UPS and USPS Connectors have been published at RSSBus.com so this can be what I wanted it to be. This sample will allow the user to input ......

Posted On Tuesday, September 22, 2009 4:02 AM | Comments (0)

10 DIY SharePoint Web Parts #5

This post is the fifth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #5 – QuickBooks Web Part! I accidently overwrote the original post. Sorry about that. Below are the steps for the QuickBooks webpart. If there are other QB searches you need to do, I can help with that. The RSSBus QBOps Connector has a ton of functionality. Step one is to make sure ......

Posted On Monday, August 24, 2009 3:06 AM | Comments (0)

10 DIY SharePoint Web Parts #4

This post is the fourth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #4 – List Active Directory Groups and Users This web part will list each user group and its members, as defined in your Active Directory (or other LDAP server) installation. Step one is to make sure you have the RSSBus Web Part installed. See here for instructions. Step two, make ......

Posted On Thursday, July 30, 2009 6:57 AM | Comments (0)

10 DIY SharePoint Web Parts #3

This post is the third in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #3 – Custom SQL Queries This web part will perform a custom SQL query, and allow you to display them however you like. Unlike previous examples, this one won’t be just cut and paste, since you’ll have to provide your own SQL connection string and query, and make replacements inside ......

Posted On Tuesday, July 14, 2009 9:30 AM | Comments (0)

10 DIY SharePoint Web Parts #2

This post is the second in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #2 – List Document Libraries and Documents For this example, we’ll make a web part that displays a list of the most recently modified document libraries/documents on the site. Lots of SharePoint sites contain many libraries, each containing dozens or even hundreds of documents. Often ......

Posted On Tuesday, July 7, 2009 3:22 AM | Comments (1)

10 DIY SharePoint Web Parts #1

This post marks the beginning of a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. After that intro you’re probably already wondering what the catch is, and yep, there is one. These examples will require the use of the highly acclaimed RSSBus SharePoint WebPart. To read all posts in this series, or to get started with the RSSBus WebPart, go here. And now…let’s get on with it! #1 – SharePoint Image Rotator Step one is to make sure you have the ......

Posted On Tuesday, June 30, 2009 3:00 AM | Comments (2)

Customize SharePoint RSS Feeds

The default RSS feeds in SharePoint are very basic and I want them to contain more information. I managed this by generating my own RSS feeds. Here is how I did it: First, install the RSSBus SharePoint WebPart. After running the setup, go to the Site Collection Features page to activate the Web Part. In order to create custom RSS feeds, you’ll also need to activate the “RSSBus Service Handler” feature. I created a special document library for my feeds, I called it “Really Simple Services”, since ......

Posted On Tuesday, May 19, 2009 2:25 PM | Comments (4)

Usenet Newsgroup Browser in SharePoint

I added a little newsgroup browser to my SharePoint site with about a one page RSSBus SharePoint WebPart template. It works by importing the RSSBus NntpOps Connector. It calls its nntpListArticles operation to list the articles of a particular newsgroup and displays them in a table. Then when an article is clicked on, it calls the nntpGetArticle operation to retrieve the actual article – don’t worry – it will only retrieve the first 1000 lines of the article – if the thread is larger than that it ......

Posted On Tuesday, May 19, 2009 1:12 PM | Comments (1)

Multi-Source Search in SharePoint

I used the RSSBus WebPart to create a multi-source search in SharePoint – this will let me enter one search term, and see results from a variety of different search services at the same time. The RSSBus WebPart template turned out to be extremely simple, thanks to its built-in feed manipulation capabilities. <div id="search"> <label for="search"><b>Se... <input id="search" type="text" name="search" size="25" value="[[_request.form:search| def('')]]" ......

Posted On Monday, May 18, 2009 2:12 PM | Comments (1)

PowerShellRSS Automatically Converts PSObjects to RSS Items

In a previous post, I talked about how PowerShellASP can be used to generate an RSS feed with PowerShell. Now I’ll show how the same feed can be generated more easily with PowerShellRSS. Again, the dir command in PowerShell (get-childitem) is used to get a listing of files to use as enclosures in the feed. # This example demonstrates how to generate an RSS feed from a call to the Get-ChildItem cmdlet (dir). # To tailor to your specific needs, set the following values: $mediadir = 'C:\Testing\media';$virtual... ......

Posted On Tuesday, May 5, 2009 5:42 PM | Comments (1)

PowerShell Prompt inside SharePoint

Using the PowerShellToys PowerShellWebPart, I was able to insert a PowerShell command prompt inside my SharePoint page with only a few lines of code and some html. Here is the PowerShellWebPart template that I used: <div style="background-color:Dar... color:white; height:400px; width:650px"> <form method="GET" action="" enctype="multipart/form-dat... PS> <input type=text name="query" size="40" value="<%=$request['quer... /> <input type=submit value="Execute" /> ......

Posted On Tuesday, May 5, 2009 3:47 PM | Comments (0)

Tweets in SharePoint – Part 3

In part 1, I showed how to add Twitter Search to SharePoint using the RSSBus WebPart. In part 2, I added input properties to the script so that the web part was controlled by the properties in the property editor. Now, I can hook this up with a regular input textbox to let the user drive the search. Now my RSSBus WebPart script looks like this: <rsb:info title="My Custom Search"> <input name="query" description="A default query" default="SharePoint" /> </rsb:info> <div align="center" ......

Posted On Thursday, April 23, 2009 1:45 PM | Comments (1)

Tweets in SharePoint – Part 2

In an earlier post I showed how I use the RSSBus SharePoint WebPart to show a list of Twitter search results in your SharePoint pages. Now I’ll expand on that a bit to show how to make the WebPart a bit more dynamic. The script of the webpart itself gives a ton of power to the webpart user. As shown before, each tweet can be formatted however you like. But we can do so much more, like specifying webpart input properties. Starting with the same script from last time, here’s how I can make the search ......

Posted On Wednesday, April 22, 2009 11:33 AM | Comments (1)

PowerShellASP – Generate an RSS feed from PowerShell cmdlets

PowerShellASP is a powerful tool for generating web pages with PowerShell. It allows you to insert PowerShell script directly into a webpage (a .ps1x page), that code will be executed and the resulting powershell objects are renderable in your page. It also exposes familiar $response, $request, $server, etc. for accessing response, request, and other information about the HTTP context. This example shows how to use PowerShellASP to generate an RSS podcast feed. The dir command in PowerShell (get-childitem) ......

Posted On Tuesday, April 21, 2009 3:08 PM | Comments (2)

Tweets In SharePoint

I saw Michael @Gannotti’s Tweets Wiki and thought it was pretty handy. It made me think of @jazzychad’s TweetGrid and how that would be nice inside SharePoint. So I combined these two into my own little twitter search page in SharePoint, and here’s how: Tools I used: RSSBus SharePoint WebPart. Installed and activated the RSSBus SharePoint WebPart, added the webpart to my SharePoint page. I went to search.twitter.com, and did a search for “PowerShell”. The results page includes the RSS feed for the ......

Posted On Tuesday, April 21, 2009 12:57 PM | Comments (0)

How RSSBus is useful in PowerShell

PowerShell users are scripters and developers who love productivity tools. That’s why you and I like PowerShell – it gives us so much to help us work more efficiently. RSSBus is another swiss-army knife of technology along this same vein, and is a handy complement to PowerShell. The biggest wins? #1, RSSBus makes it easy to get data. No matter the source of the data (tons of sources are supported already, with many more to come and an open interface so anybody can build more data connectors), with ......

Posted On Friday, April 3, 2009 12:26 PM | Comments (1)

PowerShell Custom Formatter for Mystery Objects

I needed to create a custom output formatter that would work for any object. Since I need it to work with any object, that means I won’t know before hand what properties the object has, or which of those properties I want to actually output. So, I couldn’t use any of the existing PowerShell format cmdlets like format-table, format-list, or format-custom. Instead, I needed to look at each object, get a list of its properties and their associated value(s), and then loop through those and display them ......

Posted On Friday, April 3, 2009 11:33 AM | Comments (0)

PowerShell: sync system time with Internet time server

NetCmdlet’s get-time cmdlet uses the Internet TIME protocol to query Internet time server’s for the current time. It can also be used to sync the time on the local system with that of the time server. The following PowerShell function gets the time on a time server, optionally syncs the local system to that time, and outputs both times to the console: 1: function sync-time( 2: [string] $server = "clock.psu.edu", 3: [int] $port = 37, 4: [switch] $set = $false) 5: { 6: $servertime = get-time -server ......

Posted On Monday, March 30, 2009 10:13 AM | Comments (1)

Twitter Search Web Part for SharePoint

1. I installed and activated the RSSBus Web Part for SharePoint, which allows me as a SharePoint owner or member to create a customized web part from one of dozens of RSSBus connectors or any RSS/Atom feed I like, such as a Twitter Search RSS feed. 2. I added the RSSBus Web Part to my SharePoint page, and edited its content using the Source Editor. I am using the following template to format the results of my search.twitter.com RSS result: <rsb:call op=http://search.twitter.co... ......

Posted On Friday, February 20, 2009 11:00 AM | Comments (1)

PowerShell function to determine if running on 64 bit machine

Easy a pie: function is64bit() { if ([IntPtr].Size -eq 4) { return $false } else { return $true }} Explanation: the size of an IntPtr will be 4 bytes on a 32 bit machine and 8 bytes on a 64 bit machine. I came across the tip somewhere (blog, usenet??) but I couldn't find it again - so I thought I'd share it here for anybody else who is looking for it. Technorati Tags: PowerShell ......

Posted On Friday, February 20, 2009 10:21 AM | Comments (3)

Deleting emails from PowerShell

The question was posed on the newsgroup: how do I delete emails (over POP or IMAP) on a remote mail server through PowerShell? Here’s an example of one way to do it – through the use of the get-imap, set-imap, and get-pop cmdlets that are included in NetCmdlets. ## deleteemail.ps1: Delete all email from a particular sender ## deletes emails from an IMAP or POP server. ## Returns a collection of objects containing information about deleted emails (from, to, subject) or mailboxes (name, flags) in a ......

Posted On Wednesday, September 24, 2008 3:44 PM | Comments (0)

PowerShell: ESPN-Download

“Quintas" was another of the winners of the PowerScripting Podcast’s NetCmdlets scripting contest. Quintas submitted an espn-download script, which retrieves podcast feeds from espn.com and downloads the mp3 files for later listening. Here is Quintas’ script: # ESPN-Download param($DownloadDir=$(throw "Usage: ESPN-Download.ps1 DownloadDirectory Show LatestorAllDownloaded`nShow... Mike & Mike`n2. PTI`n3. Around The Horn`n`n[L] for latestshow or [ A ] for All shows`n"), [string]$ESPNShow=$(Read-Host ......

Posted On Thursday, September 11, 2008 4:46 PM | Comments (0)

PowerShell: tweet-im

Mark Schill was another of the winners of the PowerScripting Podcast’s NetCmdlets scripting contest. Mark submitted a tweet-im script, which sends an instant message about new tweets found in the Twitter RSS feed. They explained on the podcast that Twitter used to have an IM-bot feature which went away, so Mark created this script himself to meet this need. The script simply sits and fetches your Twitter friends timeline feed every x seconds, checks to see if the items it finds are newer than the ......

Posted On Thursday, September 11, 2008 10:56 AM | Comments (0)

PowerShell: send-gmail

Over at the PowerScripting Podcast, the winners of the NetCmdlets scripting contest were announced. Meanwhile I was having some awesome vacation time in the beautiful Outer Banks of North Carolina. Winners for the /n software Netcmdlets contest are: Steve Hiner - Wrote a wrapper for Send-Email script to send email using Gmail's SMTP server Mark Schill - Sent in two entries, the one we've chosen to highlight is his Twitter IM client bot thingy. It uses Send-IM and Get-Http Quintus - A script to download ......

Posted On Wednesday, September 10, 2008 5:28 PM | Comments (0)

test-remotepath.ps1

One of the cmdlets I use most often in my scripts is test-path, which simply tells you whether or not a particular file or path exists. Below is test-remotepath, which I use to tell me if a remote file or path exists. This particular script uses get-ftp from NetCmdlets, but it could also just as easily be done with rexec, rshell, or even ssh (sexec). ## test-remotepath.ps1: Tests if a remote file/path exists ## This script uses ftp to determine whether or not a remote file or path exists. ## This ......

Posted On Monday, August 25, 2008 5:23 PM | Comments (1)

View WireShark Payload Data as Byte Arrays

A customer was having a problem receiving an SNMP trap with a 64 bit timestamp in it. In order to test, I wanted to send the exact same trap the customer was sending, using the basic UDPPort component of IP*Works! INSTEAD of the SendTrap or SendSecureTrap methods that are included in IPWorks SSNMP's SNMPAgent component. It turns out WireShark gives me an extremely easy way to do this in my code. I opened the Wireshark cap file sent to me by the customer, which only included the SNMP trap (important, ......

Posted On Tuesday, June 3, 2008 12:37 PM | Comments (1)

Zipping data from/to memory

Recently, several people have asked me the same question: How do I zip from a memory stream to a memory stream? With the Zip component that comes in IPWorks Zip, you can zip from any kind of file or stream to any kind of stream or file. There is one trick to going from memory stream to memory stream though - and that is keeping the stream open after compressing. By default, the component will automatically close an input stream after it compresses from it. But we added a config setting that you can ......

Posted On Thursday, May 22, 2008 4:04 PM | Comments (1)

FXP - FTP transfers from server to server

Every so often I get a question from someone who wants to transfer files between two FTP servers. In order to do so, they usually have to connect to server 1, download the files, and then connect to server 2 and upload the files. The process could go much sooner if they could eliminate the extra transfers and just copy the files directly from server 1 to server 2. It turns out this is possible, and is in fact mentioned in the FTP spec (RFC 959), but most people don't realize it. Also most servers ......

Posted On Thursday, May 15, 2008 12:02 PM | Comments (1)

Sending Email On Behalf Of

When you get an email from a yahoo group list, for example, it might say it was sent from yourgroup@yahoogroups.com on behalf of the person who actually sent it. Both addresses will be included in the message. This is done in SMTP with the SENDER header. If the Sender header is present, the email client should identify the mail as being "from" the sender you specify in the SENDER header (they are "the responsible mail submitter"), on behalf of the from-address that you specify in the FROM header. ......

Posted On Tuesday, February 26, 2008 4:38 PM | Comments (4)

Generate an RSS feed of Outlook Calendar Entries

Recently I was asked how one could get an RSS feed of appointments from their Outlook Calendar. Having posted previously about Google Calendar RSSBus feeds before, I thought this would be a good topic for a blog post. There is an OutlookOps connector for RSSBus, and one of the operations it contains is for listing appointments, which is useful in the free Desktop version of RSSBus. I can include a call to this operation, along with a call to the feedSearch operation, to create a sorted feed of Outlook ......

Posted On Friday, December 14, 2007 5:20 PM | Comments (0)

Tag Unions

Jon Udell is asking for a service to deliver a feed containing the union of tagged items from various services. I've been doing this for a while (though not for astronomy) using RSSBus. Here's my script: <rsb:set attr="feed#1" value="http://del.icio.us/r... /><rsb:set attr="feed#2" value="http://feeds.technor... /><rsb:set attr="feed#3" value="http://api.flickr.co... /><rsb:set ......

Posted On Thursday, October 11, 2007 3:25 PM | Comments (0)

Synching My Blog with Twitter

Continuing on with RSSBus scripts showing how to pipe Google Calendar to Twitter and Flickr to Twitter, here's my last Twitter RSBScript. Here's a script to pipe any existing RSS feed to Twitter. I wanted to sync my blog with my twitter, so now everytime I post a new blog entry, it will be added to my Twitter status. Here's the url: http://www.textbox1.com/app... blog_url=http%3A%2F%2Ffeeds... &twitter_password=mypas... &twitter_user=mytwitter... ......

Posted On Monday, August 13, 2007 3:19 PM | Comments (0)

Output any newsgroup as an RSS feed in a half dozen lines of code

Update: I changed the feed to default to partial length, only the first 1000 characters of the article body. To change it to get the full body, add another querystring parameter named full with value true, ie: http://www.textbox1.com/exa... Output any newsgroup as an RSS feed in a half dozen lines of code. Thats pretty impressive, really. How? With RSSBus and a little script that calls RSSBus NntpOps. Here's ......

Posted On Friday, November 10, 2006 5:08 PM | Comments (0)

Google Spreadsheets API: Library and Demo

Ready for some feedback. Download the library and let me know what you think. There is a csharp winforms demo included that shows how to use the GSheet class that is contained in the dll. Contents of the zip: csharpDemo - Folder containing the csharp source code of the demo GoogleSpreadsheetsAPI.dll - Library containing the GSheet class. nsoftware.IPWorksSSL.dll - IP*Works! SSL library for communications code Update: Download it here, source included. Update 2: The library is no longer available. ......

Posted On Thursday, June 8, 2006 2:14 PM | Comments (22)

Borland Developer Studio 2006

After being forced to install .Net 1.1 SP1 (ok), .Net Framework SDK v1.1 (fine), and even J# .Net 1.1 redistributable (no!), MSXML v4.0 SP2 (uh...)... I was finally able to begin installation of BDS2006. This includes support for Borland Delphi for .Net, Delphi for Win32, C# Builder, and a C++ Builder "preview". Also included are lots of extras, like components, an obfuscator, db tools, a UML designer, etc. Update: So far I'm very impressed. This seems to be much faster than BDS2005, although it ......

Posted On Monday, December 12, 2005 6:55 AM | Comments (0)

LDAP Browser

Here is a sample LDAP Browser with csharp source code. This was built using the IP*Works! LDAP component.  This zip includes the .net exe, but not that if you actually want to compile you will need to download and install IPWorks.

Posted On Friday, August 19, 2005 3:30 PM | Comments (0)

Copyright © Lance Robinson

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski