Tuesday, October 9, 2018

Windows Form Application Publish OnceClick

Publish Folder Location : is the path (e.g. C:\Publish\App)
Installation Folder URL : is IIS (e.g. http:\\localhost\AppInstall)

E.g. http://localhost/AppInstall/publish.htm

Assembly Name Product Name can be make it to different application

Friday, June 29, 2018

Git & IONIC

git branch develop
git checkout develop //use
git commit -am "change channel"
git push ionic develop

git checkout master
git merge develop
git commit -am "merge conflict" // checkin local
git push origin // push to server
git push ionic master // push to server

git status

Friday, June 1, 2018

Dowload Attachment From Google Mail using IMAP


//POP is temporary only, so use IMAP better
//Nuget S22.IMAP

using (ImapClient client = new ImapClient("imap.gmail.com", 993, "Email", "App Password", AuthMethod.Login, true))
{
    IEnumerable<uint> uids = client.Search(
         SearchCondition.From("from@mail")
         .And(SearchCondition.SentSince(new DateTime(2018, 05, 01)))
          .And(SearchCondition.SentBefore(new DateTime(2018, 06, 01))), "Mail box Name");

    Console.WriteLine(uids.Count() + " Emails:");

    foreach (var uid in uids)
    {
        MailMessage message = client.GetMessage(uid,mailbox:"Mail box Name");

        Console.WriteLine(message.Subject);

        foreach (Attachment attachment in message.Attachments)
        {
            byte[] allBytes = new byte[attachment.ContentStream.Length];
            int bytesRead = attachment.ContentStream.Read(allBytes, 0, (int)attachment.ContentStream.Length);
            string destinationFile = @"C:\\myfile\\" + attachment.Name;
            BinaryWriter writer = new BinaryWriter(new FileStream(destinationFile, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None));
            writer.Write(allBytes);
            writer.Close();
        }
   }
}

Wednesday, May 30, 2018

command not recognized

  1. Google the correct variable name and path
  2. set to environment variable
  3.  use ; to add on the value if variable name is same


Tuesday, May 29, 2018

dispatch.yaml

Override routing rules, to specific service.
  1. Create a dispatch.yaml
  2. Write Code
dispatch:
  - url: '*/favicon.ico'
    service: default
  - url: 'myurl.com/*'
    service: myservice
  1. cd dispatchfilepath
  2. gcloud config list (check is it in project ?)
  3. gcloud config set project [myproject] (if u not in project)
  4. gcloud app deploy dispatch.yaml

Sunday, May 27, 2018

Service Worker

1) is a Javascript file run in background and assists in  offline web application.
2) is a cache

<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.error('Error', err));
}
</script>

service-worker.js
var CACHE_VERSION = '0.1.1'; //Update Version

Wednesday, May 16, 2018

Ionic Framework Theory

src/index.html
- Main Entry point of App, set up script and CSS and bootstrap, start running app
- <ion-app></ion-app>

src/app/app.module.ts - entry point for the app (declaration and imports)

src/app/app.component.ts - root component, first component to load
src/app/app.htmltemplate 


ionic info - view ionic info

cordova plugin rm cordova-plugin-x-socialsharing --force
cordova plugin add cordova-plugin-x-socialsharing@5.3.2
ionic cordova platform add android@6.3.0