How to add a url to startup via registry - vb.net

I'm trying to add a URL to my system startup. I want to do this via the registry because it fits some other things I'm hoping to do later. Here's my code at the moment;
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\", "LinkLoad", "https://www.url.link")
I'm trying to do this via vb.net if at all possible. I have given the application administrative privileges but for some reason this hasn't work. The new registry key isn't in position (and to be honest I'm not 100% sure this would work in loading the webpage!).
[FYI the link in the above code is junk, I didn't think it was important to include the actual link I want to load!)

Related

How to go to a folder without specify the path

I am creating a button that will open one directory in your computer (for example: C:\Users\NameOfUser\Downloads) when you click it. But if I do this on another computer or from another user account with a different name the button doesn’t work. I just used Process.Start() for the button.
Is there a different way to do this that will work from any user account?
You can get most folder paths like this just by calling Environment.GetFolderPath() with the right Environment.SpecialFolder enum value. Unfortunately, the Downloads special folder in .Net isn't quite "special" enough and (imo) is unreasonably complicated to get. If you actually need to know the path, the correct way is to follow the accepted answer here:
Getting Downloads Folder in C#?
Even worse, it's written for C# and uses code that's not very easy to translate.
The good news is there's also a NuGet package I'd expect you can use from VB. The even better news is you don't really care about the exact path in this case. You just want to open an Explorer window via Process.Start(). That means you can use this shortcut (also available via the other question):
Process.Start("shell:Downloads")

Alfresco permissions depending on whether document is currently part of workflow or not

Out-of-the-box, an Alfresco user can read a document based on:
The document's permissions
The user's role
The user's groups
Whether the user owns the document or not
Maybe some other factors I forgot?
Now, I want to add a new factor: Whether the document is currently part of a workflow.
Alfresco's permissionDefinitions.xml allows me to define permissions based on authorities such as ROLE_LOCK_OWNER etc, but it does not seem to be the right place to add permission conditions.
I guess I will have to write some Java source code, but I am not sure what classes are responsible for this, and whether there is an Alfresco way to customize them?
So, I assume you want to somehow have nodes that are attached to a workflow have different access rights? You need to think about the behavior you want in all of the UIs and protocols you are exposing (e.g. share, WebDAV, CIFS, FTP, etc.).
If you want to set a permission on a node, you can do that via JavaScript as well as Java (See http://docs.alfresco.com/5.2/references/API-JS-setPermission.html and http://docs.alfresco.com/5.2/references/dev-services-permission.html). As was mentioned in one of the comments, you can also get the number of active workflows on a node by referencing the activeWorkflows property in JavaScript (http://docs.alfresco.com/5.2/references/API-JS-ScriptNode.html) or in Java
Depending on the specifics, I might implement this in different ways, but if all you want to do is have the permission change, you could just update it at the beginning and end of your workflow with a simple javascript call. The only thing bad about that is that it doesn't take into consideration the workflow getting canceled. You could also create a policy/behavior on an aspect you attach or even have a rule or job run that updates content based on the activeWorkflows values.

Need advice on creating an online contract generation system

First of all, be assured I am not asking how to write up a contract; I already have that covered. My question is how I can best program a system for generating it for clients to digitally sign?
My original plan that just seems like overkill to me is this:
I fill in all the details.
Click a button to preview it, making sure everything is correct.
Click a button to simultaneously create a directory for the client and create 3 files inside that directory.
The three newly created files are:
the unsigned contract.
a confirmation page of having signed the contract, with other details the client will need to know.
the actual signed contract that the client can now view online at any time by going to a URL such as /clients/username/index.php
I have it working, though I keep thinking it could be simplified further, but not sure of the best way to do it.
Any suggestions?
I recently helped on a project much like this, & I think you've got the right idea...
Write up the contract & preview (make sure it's right)
Have them come "sign" it
Save it
Only thing I'd change is, I'd use a DB instead of file creation. Personally, I find that simpler, but it might not feel that way to everybody. It's definitely more flexible though, 'cause you can easily generate an HTML or a PDF from the DB data, but you'd have a harder time doing that from a file on the system. Assuming you're using PHP (based on the .php you mentioned), there's a whole section of functions for generating PDF's in PHP.

Windows 8 store package fails on WACK when login to developer account

I'm trying to put a simple app on windows store. I made a fail attempt once, I submitted an app which failed to pass WACK, eventually it failed on submission too. Even then, when I try to package an app with my developer account logged in, I get a performance launch error.
Even on a blank app. also right after I create package logged in, my app's package name and provider fields on appmanifest are changes too. app's package name changes to the first app I submitted, and the provider changes to I guess my developer account's key.
I deleted my failed submission on dashboard, deleted all the names I reserved, including the failed one. But even when I reserve a new name and package my app with that name, my package name still changes to the very first one and fails on wack.
BUT, when I create package of my app WITHOUT logging in, I mean without associate with windows store, I can package my app with the name I want and pass the WACK. I hope anyone can help me with this.
Edit: C# application.
I had this happen too, it seems like WACK got confused and kept trying to verify the wrong version. The following steps resolved it for me:
Uninstall the app from your development PC (as in, go to start page,
right click on the app and select uninstall).
Reboot the dev PC.
Select "Local Machine" and "Release".
Start debugging wait for it to
have started up completely and then stop debugging.
Pretty sure that only one or two of those steps are actually needed, but not sure which ones.
I'm not completely sure I understand your issue, but let me try...
First, what is the failure that you got when you submitted to the Store and when you ran the WACK? You mentioned a "performance launch error". If you are failing the performance test, check out this article for tips to help. Some examples:
Package content locally (or cache it) when possible, so you don’t have to pull resources from a network during launch.
Load and do only what you need on launch. You can load other data and do other work asynchronously in the background or when you actually need it.
Use a "dirty bit" when saving data on suspend, so you only save data that has changed. (Rather than re-serializing your app’s state if that data hasn’t changed, create a Boolean flag variable (or “dirty bit”) which signals that your data has been modified, and only re-serialize when the data has changed.)
Use bytecode caching if you are developing in JavaScript, so each JS file has bytecode created once and not every time the app launches. To enable this, make sure all JavaScript files are UTF8 encoded with a byte-order mark (BOM) and are statically referenced in the root of your HTML start page.
If this is not the error that the WACK and your Store certification is failing with, please see this blog post and the related blog posts that it links to, to see if your failure is covered there.
Secondly, your issue with associating your code with your reserved name in the Windows Store:
also right after I create package logged in, my app's package name and
provider fields on appmanifest are changes too.
This behavior is expected. When you associate your app package with the Windows Store, it will change the "Package name" and the publisher in your appxmanifest. But that's okay! The "Package name" is just what the Windows Store uses as an internal identifier for your app package, and the "Package display name" (right below it in the appxmanifest) is what your end users will see. Set the "Package display name" to what you want.

Joomla: Allowing a user to upload an image

Alright so I learned that to have an upload button on a page, what you do is basically call a php file (call is upload.php) that would upload a file to the server. I have no idea where I am supposed to put the php file inside the server so I can call it.
I feel stupid because I can't find any answers online. I am getting very frustrated and confused because I am told I need to create a database but I have no idea how to edit a database in Joomla. I took a class in SQL so I don't have to learn about that. I just don't know where it is. I was also told I need to make a component. But this is confusing because all I want to do is have an upload button that will upload an image to the server.
I understand your frustration. I've got the basic idea on what you are trying to do. Here are a couple of options:
You might wanna take a look at Joomla! Extensions Directory ™. You might just find there a component or a module that already does this for you.
If you want to do it on your own, than you need to create a small module or a component inside Joomla! Please refer to the Joomla! Documentation or tutorials on this topic. Please note that you won't get this working instantly, because you first need to understand how Joomla! works. So your upload.php file will go in your module / component files. I don't think you need to do any SQL.
Now the part with "allowing a user" is a bit confusing... you want to "allow" any user to upload things to your server or just let's say, registered users? Generally uploading scripts need to be very strong from the security point of view. If this is the case, that you need to do a search for Joomla! ACL
You can simply create a form and add the "media" field type.
http://docs.joomla.org/Standard_form_field_types
You can also opt for the "file" field types to allow different types of fields.
Both fields can be added using the Joomla Component Creator: http://www.notwebdesign.com/joomla-component-creator/
And you might also want to take a look at K2 which has an excellent image upload functionality that allows scaling of images into three different sizes.