Updating Angular 2 + ASP.NET Core Web Template for Visual Studio 2017 RTM

I am currently starting a new project for ASP.NET Core 1.1 when I suddenly realized that there’s a template that I can probably use for this.  Unfortunately though, the VS extension isn’t updated yet for Visual Studio 2017.

blog-01-vs2015

If you try to install this with only VS 2017 installed in your machine, you won’t be able to and you’ll be faced with this error –

blog-02-install-error

Fortunately, not all is lost yet. You can still install this template on your machine by doing the following:
Continue reading “Updating Angular 2 + ASP.NET Core Web Template for Visual Studio 2017 RTM”

Advertisements

Friendster Bug?

fslogo

I am currently studying some of the existing social networking sites for one project that I have been doing. In my laptop, my profile cookie in Friendster is saved since I am the only person using that laptop. That alone would save me from entering my credentials over and over again when I visit that page.

A certain concept in the design of social networking sites is common across sites and that is having a “limited” profile view. That is, you won’t be able to see the whole profile of the person you are viewing unless you are a contact or a friend of that person. Facebook’s implementation is too conservative while LinkedIn’s is customizable. Beyond Multiply (which I am more familiar with), Friendster is one of those popular social networking sites here in the Philippines, and I reviewed it. I barely check on other’s profile that’s why I don’t have a complete picture of how can you view a restricted profile in Friendster. I opened my IE wherein I am not logged-in in Friendster. I was able to see the “restricted” view of my friend’s profile BUT I noticed that the “Login” link was changed to “Log Out”. When I clicked on the “Profile” tab, my page was loaded.

I logged-out from Friendster in IE (even if I didn’t log-in), had a hard refresh (ctrl+f5) around 5 times. Closed the browser and repeated the same steps again and I found out that I was even logged in after all those things. Could this be another case of a faulty security implementation? As far as I know, two different browsers cannot share the same cookie of the same domain. From what I suspect, Friendster could have been storing sessions of users in their database that includes the username/email of the person, IP address, and the time they were last seen online. If a request has been made from another browser (say in my case in IE, where I am not logged-in) when a user tries to view a user but isn’t logged-in, the request would check from the database if an active session is in place from the same IP address and if a record is found, the request would make an authentication cookie in the browser even if he/she hasn’t logged-in in the system. I think this scenario is a security concern – case for example would be in a typical internet cafe set-up where only one public IP is being published, it is possible that even if you’re not logged-in in your account, you would be able to gain some “control” over the other accounts. While other features would prevent you from changing the password but the mere fact that you are able to log-in to an account isn’t yours or didn’t intentionally log-in, once the intruder makes some changes to your profile, it could mean a lot of things especially those that can see the spoiled information.

I am not sure if you can replicate the error, I think it is not just happening to me. Try it and let’s talk it over.

Name That Code

Because I am bored in the office waiting for work and the $@#%^#^#$^@#!@#%& reply of Cebu Pacific for my concern for more than 2 weeks already, I didn’t hesitate to take a quiz:

Name That Code

Try it for yourselves as well. At any rate, it would help you refresh some technical knowledge.

Surprise!

I received an e-mail from Microsoft informing me that I was awarded as a Microsoft Most Valuable Professional for the ASP/ASP.NET technical communities for the July 2008 cycle.

As the official site states:

Microsoft Most Valuable Professionals (MVPs) are exceptional technical community leaders from around the world who are awarded for voluntarily sharing their high quality, real world expertise in offline and online technical communities. Microsoft MVPs are a highly select group of experts that represents the technical community’s best and brightest, and they share a deep commitment to community and a willingness to help others.

Good news do really come after the bad ones. My laptop just got broken as well as my camera is now malfunctioning. Talk about good riddance.

Nonetheless, again, thanks to all who supported me and in all the endeavors that made this possible. Ad astra per aspera!

Building Some Web TreeViews

The TreeView control in ASP.NET 2.0 is used to display hierarchical data, such as table of contents or file directory in a tree structure. In most applications that I do, I use the TreeView control to show file directory structure. I was able to create a class that populates a TreeView provided with a physical directory structure residing on the same computer as to where the server is running. Rename the file below to .dll and use it as a reference on your web application. Once added to your web application usage would be:


using System;
// include other namespaces as needed
using PhysicalTreeView;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string location;
        pTreeView ptv = new pTreeView(location);
        // the example below is valid without specifying the "isWeb" to false.
        pTreeView ptv = new pTreeView("~/");
        ptv.isWeb = false;
        ptv.PopulateTree(TreeView1);
    }
}

By default, the variable location will treat the path as a virtual path. If you want to specify a specific physical directory, you can specify the 8 character directory format as a location value but you need to specify the property “isWeb” as “false” and as shown above. The “TreeView1” is assumed to be a TreeView control placed onto the ASPX file. For testing purposes, you can put in your code behind the following code without placing a TreeView control in your ASPX file but will output the same.


TreeView TreeView1 = new TreeView();
string location;
pTreeView ptv = new pTreeView(location);
// the example below is valid without specifying the "isWeb" to false.
pTreeView ptv = new pTreeView("~/");
ptv.isWeb = false;
ptv.PopulateTree(TreeView1);

this.Form.Controls.Add(TreeView1);

Physical Drive TreeView DLL

The challenge for me is to bring the same functionality to a SourceSafe database which is despite having a directory like structure isn’t directory based at all when accessed programmatically. Furthermore, the DLL provided with Visual Source Safe 2005 isn’t a native .NET object but a COM interop one.

Luckily, using the same logic behind the previous DLL, I managed to create a DLL to populate a TreeView from a SourceSafe database. The constructor needs only 3 parameters namely the database location, username, and password.

Sample usage would be:


using ProjectTreeView;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        string location, user, password;
        // Populate your own values 

        ssTreeView stv = new ssTreeView(location, user, password);
        stv.BuildSourceSafeTree(TreeView1);

    }
}

Same with the code above, the code assumes that there’s a TreeView control instance in the ASPX file that has an ID of “TreeView1”.

Sourcesafe TreeView

For questions, feel free to add some comments. 🙂

Sourcesafe Automation Bug

As part of my continuing project in Sourcesafe Automation, I found a weird behavior of the Visual Studio Sourcesafe Interop DLL.

The following code is in Visual Basic 5 which basically connects to a Sourcesafe database and lists all the projects in the root folder of the database.


Dim vssdb As New VSSDatabase
 
vssdb.Open "<location to sourcesafe srcsafe.ini>", "<username>", "<password>"
 
Dim xitem As VSSItem
For Each xitem In vssdb.VSSItem(0).Items(False)
   Debug.Print (xitem.Name)
Next

Subsequently, the code equivalent in C# (.NET) , is something that I have blogged before. What I find unusual about the Sourcesafe Interop DLL are the following items:

Continue reading “Sourcesafe Automation Bug”