Two Factor Authentication

  • Bruce Armstrong
  • Bruce Armstrong's Avatar Code Author
  • Online
More
20 hours 27 minutes ago #260 by Bruce Armstrong
Bruce Armstrong replied the code: Two Factor Authentication
Ah, need to make a correction in my last response. I forgot that the solution I provided references Windows.Forms (even for the CCW used by native PowerBuilder). The SnapDevelop IDE that Appeon provides only targets .Net Core and .Net Standard. Windows Form is (not yet) part of .Net Core or .Net Standard. There is a preview of .Net Core 3.0 available that includes it, but for now that means we can't use SnapDevelop. It also means we can't use Visual Studio Code either.

In any event, here's that C# code I had for the PowerBuilder CCW, but in plain C# rather than the modified syntax that PowerBuilder.Net used. If you're using Visual Studio, you just add a reference to the Windows.Forms assembly and use code similar to this:

using System;
using System.Windows.Forms;
using System.Collections.Specialized;

namespace DragAndDropDemo
{
public class DragAndDrop
{
public void DoDragAndDrop(string filename)
{
StringCollection files = new StringCollection();
files.Add(filename);
DataObject dataObject = new DataObject();
dataObject.SetFileDropList ( files ) ;
Control control = new System.Windows.Forms.Control();
control.DoDragDrop(dataObject, System.Windows.Forms.DragDropEffects.Copy);
}
}
}

I did verify it compiles. I didn't go as far as to create it as a CCW or attempt to use it.

Please Log in or Create an account to join the conversation.

More
4 days 11 hours ago #259 by Rick Domogalik
Rick Domogalik replied the code: Two Factor Authentication
Bruce,

Thanks for the response. After some checking I have determined that the version of PowerBuilder I subscribe to does not include the C# editor. I can upgrade to the Cloud version and get it, just not sure if that is the correct course to take. I also checked into Visual Studio Code. I am very comfortable coding in PowerBuilder, but Visual studio Code seems like a steep learning curve to get up to speed on for me. In your opinion, would using the C# editor from Appeon be easier for someone who is familiar with PowerBuilder? Just trying to determine the best way to move forward with my project and either get up to speed with Visual Studio or Upgrade to the Cloud account with Appeon and use their C# editor.

Also, would you happen to have any examples of the assemblies to enable the drag/drop functionality with PowerBuilder and Windows Explorer? I tend to learn best looking at an example piece of code.

Thanks for your help!

Rick

Please Log in or Create an account to join the conversation.

  • Bruce Armstrong
  • Bruce Armstrong's Avatar Code Author
  • Online
More
5 days 6 hours ago #258 by Bruce Armstrong
Bruce Armstrong replied the code: Two Factor Authentication
It's just standard C# code. I did it in PowerBuilder.Net at the time because I assumed readers at that time would have that available to them.

PowerBuilder 2019 has it's own C# editor, and you can create assemblies there as well. I'd recommend trying that.

You can also use any C# editor of your choosing:
  • Visual Studio ($1200 for first year for Professional)
  • Visual Studio Code (free)
  • JetBrains Rider ($140 for first year)
  • SharpDevelop (free, but may be dead, last release was in 2016)
  • MonoDevelop (free)
  • and others.....

Please Log in or Create an account to join the conversation.

More
5 days 10 hours ago #257 by Rick Domogalik
Rick Domogalik replied the code: Two Factor Authentication
Bruce,

This is off this topic but I wanted to ask you a question about an article you wrote about dragging files out of a PowerBuilder app to Windows Explorer.

Here's a link to the article.
blogs.sap.com/2012/10/26/implementing-dr...to-windows-explorer/

I am trying to implement similar functionality to this in PowerBuilder 2019. I don't have access to PowerBuilder.net. At least I don't think I do with the standard subscription. So I don't think I can create the .NET assembly to use as you suggest with a Win32 app.

Is there a new way to do this (article is 7 years old)? Or am I in need of getting access to PowerBuilder.net? Don't even know if this is still accessible.

Any suggestions would be greatly appreciated!

Rick

Please Log in or Create an account to join the conversation.

  • Bruce Armstrong
  • Bruce Armstrong's Avatar Code Author
  • Online
More
2 months 2 weeks ago #253 by Bruce Armstrong
Bruce Armstrong replied the code: Two Factor Authentication
Well, Google Image Charts, despite the notices that it was shutdown, appears to still work.

A QR code is a QR code, so it really doesn't matter how you generate it. The discussion forums indicate that www.image-charts.com/ is a drop in replacement for Google Image Charts. It does cost money though. There are also other free qr code api services such as goqr.me/api/

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #252 by Berit Sandvik
Berit Sandvik replied the code: Two Factor Authentication
Hi Bruce,
I have downloaded the zip file for generating QR codes and it works perfect!
However, when I search for ways of generating QR codes on the web, there are a lot of articles telling that Google chart is deprecated and does not work any more. It was turned off March 25th 2019. Ref. developers.google.com/chart/image/docs/gallery/map_charts and news group .

Which version of Google chart is used in your example? According to the articles I have found online, the new substitution for Google Image Charts which is Google Charts, does not have any functionality for generating QR codes. So this does not make sense to me.


ls_chart_url = ' chart.apis.google.com/chart?cht=qr&chs= ' + String ( width ) + 'x' + String ( height ) + '&chl=' + ls_provision_url

Looking forward to hearing from you. Thanks!

Regards from Berit

Please Log in or Create an account to join the conversation.

  • Bruce Armstrong
  • Bruce Armstrong's Avatar Code Author
  • Online
More
3 months 6 days ago #247 by Bruce Armstrong
Bruce Armstrong created the code: Two Factor Authentication
Sample code showing how to do two factor authentication using PowerBuilder

This message has an attachment file.
Please log in or register to see it.

Please Log in or Create an account to join the conversation.

Moderators: Appeon Administrator