Microsoft Development

48K

Solutions

32K

Contributors

Most development for the Microsoft platform is done utilizing the technologies supported by the.NET framework. Other development is done using Visual Basic for Applications (VBA) for programs like Access, Excel, Word and Outlook, with PowerShell for scripting, or with SQL for large databases.

Share tech news, updates, or what's on your mind.

Sign up to Post

What are the big benefits of .NET CORE?

And how do they differentiate from .NET Framework?
0
Cloud Class® Course: Microsoft Windows 7 Basic
LVL 12
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Please high level what microservices can do?

And from a C# perspective, what is the best way to create them?

.NET CORE?

etc...
0
Hi, there is 'using System;' in the beginning of the file.

However  Console. WriteLine doesn't compile and requires System.Console.WriteLine.
Why? How can it be fixed?

Thanks.
0
Hi everybody,

I have a question about in-class initialization and thread-safety. I searched a lot in the net about this but wasn't able to figure it out.

I (accidentally) found a IMO nice way to implement somehting like an instance counter using in-class initialization like this:
// sample 1 using a static class member
struct Test1
{
	static int current;
	int num{ current++ };
};

int Test1::current{ 0 };

// sample 2 using singleton desing pattern
struct Test2
{
	static int& current()
	{
		static int curr{ 0 };
		return curr;
	}

	int num{ current()++ };
};

Open in new window

Both methods work fine:
void foo()
{
	for ( int n = 0; n < 5; n++ )
	{
		std::cout << "T1: " << Test1{}.num << " T2: " << Test2{}.num << std::endl;
	}
}

// output is as expected:
// T1: 0 T2: 0
// T1: 1 T2: 1
// T1: 2 T2: 2
// T1: 3 T2: 3
// T1: 4 T2: 4

Open in new window

Now I'm curious if this is thread safe. I know the instantiation of current itself is thread-safe, but I'm not sure what's about the ++ operator call: especially in the second example I would guess the ++ called for the returned reference is not thread safe, but on the other side I think compilers do a lot of complicated things to make statics thread safe, so probably my suspection is wrong.

JFI: I'm not sure since which C++ standard this can be used, I use C++17 (VS 2017), but maybe it works with older versions too.

Does anyone of you know better?

Best regards,

ZOPPO
0
background: had vs2010, 2013, and 2017 community.   Just uninstalled 2010 and 2013 because of issues.  

I have a project with a component that we wrote, in vs2010 & .net 4.0.  I've created a new solution, imported the old projects within the solution.   It now have .net 4.7.1 since 4.0 is not available in the list anymore (and not downloadable apparently).   This component was using the Extensibility Tool (which i've installed on vs2017).

But i still have some errors, all related to this component:

CS0616	ProvideToolboxControlAttribute' is not an attribute class
CS0641	Attribute 'AttributeUsage' is only valid on classes derived from System.Attribute

Open in new window


Note: within this file, beside System and System.Globalization, all the other "Using" are greyed out, like if they where not used.  

Anyone can help?  These classes are deprecated? (AttributeUsage?)  How can i solve this issue?

Thanks
ProvideToolboxControlAttribute.cs
0
Whenever I perform a search within a document in Visual Studio it always highlights this characters below, besides the word I searched for, which makes it very hard to find what I was searching for:
 <%
%>

How can I disable highlighting those characters ?
0
Hi
I need your help . I think there is possible to use something in Visual Studio Net (2017, C#) to calculate FFT, FIR and IIR filters.  I remember I read it somewhere but
I don't remember what was it.
Do you know what can I use for very fast process?
Looking forward for your suggestions.
0
When I manually move an email to a #folder I want a popup asking me if I want to create a rule called #folder to always move mails from its #sender to the #folder.
0
I created a custom ContextMenuStrip at runtime on an overrided RichTextBox control (to enable Cancel, Cut, Copy and Paste basic functions on my overrided RichTextBox) - since the RichTextBox doesn't implement this out-of-the-box.
At runtime, I do get my ContextMenuStrip popping up when I right click on my overrided RichTextBox and the menus work well, BUT when I move the mouse over the ContextMenuStrip, I don't see the selection tracker over the menus. Why so? And how can I fix this?

       
        private void CreateContextMenuStrip()
        {
            _cms = new ContextMenuStrip();
            _cms.Items.Add(new ToolStripLabel("Annuler", null, false, cms_Clicked, "mnuCancel"));
            _cms.Items.Add(new ToolStripSeparator());
            _cms.Items.Add(new ToolStripLabel("Couper", null, false, cms_Clicked, "mnuCut"));
            _cms.Items.Add(new ToolStripLabel("Copier", null, false, cms_Clicked, "mnuCopy"));
            _cms.Items.Add(new ToolStripLabel("Coller", null, false, cms_Clicked, "mnuPaste"));
            _cms.Items.Add(new ToolStripSeparator());
            _cms.Items.Add(new ToolStripLabel("Tout sélectionner", null, false, cms_Clicked, "mnuSelectAll"));
            _cms.Items["mnuSelectAll"].Width = 150;
            _cms.Opening += new CancelEventHandler(cms_Opening);
            this.ContextMenuStrip = _cms;
        }

        private void cms_Opening(object sender, CancelEventArgs e)
        {
            // check to see if we can 

Open in new window

0
I have developed a form in Fastfield forms. I am trying to use Zapier to send the Fastfield form as a text message after the form is filled out.  The text message is being sent, but the form with the information is not in the form. the question that I have is: Does Zapier interface with Fastfield?
Help is greatly appreciated.
0
Cloud Class® Course: Python 3 Fundamentals
LVL 12
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Hello,

I'm working on a project. Need to work in 2 shifts.
9am to 5pm, and 9pm to 5am.

How do I make and manage calendars?

San
0
My company run Exchange server 2016 and Outlook 2016
Some users have have many (hunderds) of folder in their inbox keeped updated manually. I want to automatically create rules to keep their structure updated.

Let me expain with an exemple:

(inbox) exemple@mycompany.com
- Folder Clients
> Sub folder A
>> mail from exemple1@a.com
>> mail from exemple2@a.com
>> mail from exemple1@a.com
> Sub folder B
>> mail from exemple1@b.com
> Sub foldder C
- Folder suppliers


Selecting a folder I want to automatically create rules for all subfolders. In this exemple selecting the root I want to create those rules:
1) move mail from exemple1@a.com or exemple2@a.com to folder clients/A
2) move mail from exemple1@b.com to folder clients/B
1
I have many (hunderds) of folder in my inbox. I divide clients in 1 folder for any region and then 1 folder for any client. I keep this structure updated manually over ther years.

I want to automatically create rules to keep this structure updated. Something like: for any unique sender address in a folder create a rule to move the the actual folder.

> Exchange server 2016
> Outlook 2016


How can I do so?
0
Need exercises on the Big O Notation

I have engineering optimization on various software projects in the past, but need to pass a test which will evaluate my skills solving the Big O Notation.

I will need to code in C# with arrays, data sets and the like as a way to show I can optimize code.

Any exercises I could play around with?

Thanks.
0
In Microsoft Word Table, Open file in scite text editor from hyperlink or onclick
How can I set up a hyperlink to open a file with the self-executing scite text editor in the same directory

I've tried

scite.exe filename
0
We are teaching programming to kids and having problems with the Atom IDE as we need to add a new user account for each new student on the PC. So we are looking for an IDE that can be installed from within our administrative account (teacher) and configured properly with some extensions, and then we would like to be able to add a new user account on the same Windows 10 laptop and would like the user to use the VS Code WITH installed extensions without having to re-install those extensions every time a new user is added to the same computer. Is that possible? So the procedure we would like to have is:
1. From an Administrator account on a Windows 10 PC we would like to install VS Code for All Users.
2. From the same account, we would like to add some extensions to VS Code that will fit our needs.
3. Then we would like to add a standard user account on the same PC from which the user can open and work with VS Code and hopefully with all the extensions we installed from within the Administrator account previously.

If that is not possible, meaning the extensions will not be available from this new user account, would it then be possible in some way with the help of a macro program like AutoHotkey to place or add the relevant extensions somewhere so that the new user can add them first thing when he opens VS Code? or do they have to be downloaded every time when we add a new user account?
0
Hello everyone,

could any one can help me to find out the difference between "Text from file" option and paste (ctrl+v) in ms word
0
The client gave me a WSDL file and from that I'm using svcutil.exe to generate the proxy class.   I did the following steps:

1) Opened up Developer Command Prompt for VS2015
2) Ran the following command > svcutil.exe CORETransactionService.wsdl CORETransactionService_schema1.xsd

I get the following error:
The attached file (outputfromSVCUTIL.png)

If I removed this from the wsdl file
 <wsp:Policy wsu:Id="wsp-d022643e-c1aa-467f-8471-f28e404d63fb"><ns2:AsymmetricBinding xmlns:ns2="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"><wsp:Policy><ns2:InitiatorToken><wsp:Policy><ns2:X509Token ns2:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient"><wsp:Policy><ns2:WssX509V3Token10/></wsp:Policy></ns2:X509Token></wsp:Policy></ns2:InitiatorToken><ns2:AlgorithmSuite><wsp:Policy><ns2:STRTransform10/><ns2:Basic128/></wsp:Policy></ns2:AlgorithmSuite><ns2:RecipientToken><wsp:Policy><ns2:X509Token ns2:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToInitiator"><wsp:Policy><ns2:WssX509V3Token10/></wsp:Policy></ns2:X509Token></wsp:Policy></ns2:RecipientToken><ns2:Layout><wsp:Policy><ns2:Strict/></wsp:Policy></ns2:Layout></wsp:Policy></ns2:AsymmetricBinding><ns2:Wss11 xmlns:ns2="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"><wsp:Policy><ns2:RequireSignatureConfirmation/></wsp:Policy></ns2:Wss11></wsp:Policy>
    <wsp:Policy …
0
I just download Microsoft visual studio 2017 but the window is not the same as 2010. Can you please tell me how to create a new asp.net mvc project in it with c sharp coding? I am using windows 7
screenshot.PNG
0
Cloud Class® Course: C++ 11 Fundamentals
LVL 12
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

environment sp 2010 workflows on 2013 - no farm admin support, full control only 2013 workflows not available. JS within a page is ok.

I have a workflow which emails out certain list record information.
In this email, I need to put a link which will start another workflow (set to manual) without displaying the initiation screen. This second one can't be set to new/modified triggers. On a private LAN - assume user who reads the email is also authenticated to the list and have permissions to the list. Mobile access etc not needed.  The link can include whatever information needs to be passed (ID, list guid, ... )

I've seen several posts about this but none seem to skip the initiation screen. I don't mind them linking to a page with parameters which tend runs JS and then afterwards directs to the home page of site if necessary. I know how to do the JS to update the record appropriately but was hoping for a workflow based solution entirely. After the JS finishes I don't want to leave the user in the editform - they should never see the editform - just click on the link in outlook and it does the rest without users being involved.

I do not want to put links in the view of the list - only in Outlook
0
Why can I not update the URL in the browser?

I update QueryString and remove a malicious parameter. But, after executing the following code:

                filterContext.HttpContext.RewritePath(filterContext.HttpContext.Request.Path,
                                                       filterContext.HttpContext.Request.PathInfo,
                                                       filterContext.HttpContext.Request.QueryString.ToString());

Still see that bad domain.

I may be fighting development automation inside my own project;

I paste the following into the browser...

http://SENB-0186.mydomain.org/ContentManagement/?
goto=http%3a%2f%2fsenb-0186.mydomain.org.evil.com%3a80%2fContentManagement%2f

My code captures the goto parameter and removes it from the QueryString. I call the RewritePath() function above, and see the following in the browser


https://dev.nim.mydomain.org/IdentityServices//?return=http://senb-0186.mydomain.org
/ContentManagement/Account/LogOn?ReturnUrl=%2fContentManagement%2f%3fgoto%3dhttp%253a%252f%252f
senb-0186.mydomain.org.evil.com%253a80%252fContentManagement%252f&u
gid=040dec88-8a99-4410-bf72-1d868a207c8d

I have no problem with the introduction of https://dev.nim.mydomain.org/IdentityServices//?
but I do have a problem that the  mydomain.org.evil.com sub-domain re-appears.

Suggestions?

I even created a copy of QueryString, made the deletions on the sanitized version. But that also fails.

                …
0
Need to Redirect after removing one or more query string params.


I am using a whitelist to remove dangerous query string params, and when done, need to redirect to whatever is left in the  query string.

I understand things may break, but am okay letting our website's existing default behavior handle it.

What is the exact command to redirect?

ActionExecutingContext filterContext is the input param of the ActionFilterAttribute

        public override void OnActionExecuting(ActionExecutingContext filterContext)

and after removing the faulty query string params from:

filterContext.HttpContext.Request.QueryString

I am ready to redirect.

                filterContext.HttpContext.Response.Redirect(filterContext.HttpContext.Request.);

Please complete the the above parameter for Redirect()

Thanks
0
I need to remove a dangerous domain from the URL, but the QueryString Collection is Read Only.
             
I created a whitelist of safe URL's and scan the URL inside a custom ActionFilterAttribute to assert that every domain is whitelisted:

But rather than upsetting existing program flow by redirecting to an error page, we have decided to simply remove that dangerous domain. If the goto or returnURL is errant, I need to completely remove it. But, the QueryString Collection is Read Only.

I use the following code to remove the "goto" key and notice the NameValueCollection array drops from a size of 1 to 0.

        private void RemoveParameter(NameValueCollection nameCollection, string keyToRemove)
        {
            // reflect to readonly property
            PropertyInfo isreadonly = typeof(System.Collections.Specialized.NameValueCollection).GetProperty("IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);

            if (isreadonly != null)
            {
                // make collection editable
                isreadonly.SetValue(nameCollection, false, null);

                // remove
                nameCollection.Remove(keyToRemove);

                // make collection readonly again
                isreadonly.SetValue(nameCollection, true, null);
            }
        }

Open in new window


but even after a final call to:

            base.OnActionExecuting(filterContext)

the browser still has the bad domain in the goto. In fact, I was expecting "goto" to no longer display.

What am I missing?

Thanks
0
RedirectResult from ActionFilterAttribute

I made a custom ActionFilterAttribute which checks a URL to see if the domains are contained in a whitelist of domains. It's working, but I need to redirect to a failure page on failure.

Can I use the following call?

filterContext.Result = new RedirectResult("/error/Unauthorized");

and what about the path?

I see

ErrorController : Controller
 
with the following action method

public ActionResult Unauthorized

and it returns the following view:

            return View("UserNoPermissions");

and I see the Shared View

UserNoPermissions.cshtml

yet, I get the error:


HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Suggestions?
0
I am hoping to use the Uri object to reject the following XSS exposure.

for example, a return URL which includes the following puts your website at risk:

https://yourdomain.org/?returnurl=yourdomain.org.evildomain.com

So, I hope I can use the  System.Uri object to throw an exception. This means I do not get into modifying my RegEx.

I would be surprised to learn that  the following is not a reg flag:

yourdomain.org.evildomain.com

thanks
0

Microsoft Development

48K

Solutions

32K

Contributors

Most development for the Microsoft platform is done utilizing the technologies supported by the.NET framework. Other development is done using Visual Basic for Applications (VBA) for programs like Access, Excel, Word and Outlook, with PowerShell for scripting, or with SQL for large databases.