Improve company productivity with a Business Account.Sign Up

x

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

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
Free Tool: IP Lookup
LVL 12
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi,

I'm in the process of developing an eBay application in Microsoft Access 2016. So far my project has been fine and the API calls I have made have been successful but I have now come to a stumbling block that I need some help with.

The API calls I have used so far are all for single listings so this is easy and I just pass the XML through an HTTP request. I want to make this much more efficient and use eBay's File Transfer API where I can send more than 1 call at a time but I'm really struggling on trying to understand how to build the call.

The data has to be sent as Binary Base64 which I have a converter to do this. I can build the XML that needs to be sent but I just don't understand how to send the XML from a string as apposed to a physical file.

I've read loads on the internet about having to create it as a multipart request with boundaries but really not sure how to start building that. I can provide code if need be so you can see where I am at.

I hope this makes sense.
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
I have the following code which successfully opens a hyperlink in internet explorer from an email in Outlook.

My next question is how do I interact with the webpage?

For example I would like to select option 83 from ID "ctl00_cph_MAIN_ddlHCLaction" which is a dropdown.

I have tried
oIE.document.GetElementbyID("ctl00_cph_MAIN_ddlHCLaction").value = 83

Open in new window

but I get the error

'Run-time error '-2147467259 (80004005)': method 'document' of object 'IWebBrowser2' failed.'

Sub macro()

Dim regex
    Set objOL = CreateObject("Outlook.Application")
    Set NewMail = objOL.ActiveExplorer.Selection.Item(1)
    NewMail.Display
    res = NewMail.Body
    
    Set regex = CreateObject("VBScript.RegExp")

    With regex
        .Global = False
        .MultiLine = False
        .IgnoreCase = True
        .Pattern = "HYPERLINK ""([^""]+?)""Click here to access enquiry"
    End With
    Set mtches = regex.Execute(res)
        If mtches.Count > 0 Then
            strHL = mtches(0).submatches(0)
            Set oIE = New InternetExplorerMedium
            oIE.navigate strHL, CLng(2048)
            oIE.Visible = True
        End If
End Sub

Open in new window

0
Hi All,
I am trying to get service configuration information for SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO. my code as below

void DoQuerySvc()
{
    SC_HANDLE schSCManager;
    SC_HANDLE schService;
      DT_String  szSvcName = Server.GetProductName(); // get the service name
    LPQUERY_SERVICE_CONFIG lpsc;
      LPSERVICE_REQUIRED_PRIVILEGES_INFO lpsd;
    DWORD dwBytesNeeded = 0, dwError = 0;
      DWORD cbBufSize = 0;

    // Get a handle to the SCM database.

    schSCManager = OpenSCManager(
        NULL,                    // local computer
        NULL,                    // ServicesActive database
        SC_MANAGER_ALL_ACCESS);  // full access rights

    if (NULL == schSCManager)
    {
        printf("OpenSCManager failed (%d)\n", GetLastError());
        return;
    }

    // Get a handle to the service.

    schService = OpenService(
        schSCManager,          // SCM database
        szSvcName,             // name of service
        SERVICE_QUERY_CONFIG); // need query config access

    if (schService == NULL)
    {
        printf("OpenService failed (%d)\n", GetLastError());
        CloseServiceHandle(schSCManager);
        return;
    }

    // Get the configuration information.

   
       if( !QueryServiceConfig2W(
        schService,
        SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO,
        NULL,
        0,
        &dwBytesNeeded))
    {
        dwError = GetLastError();
        if( …
0
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
I have one scenario in Sync Framework 2.1

Suppose we have one customer table which has two column PId,Name and order table which has two column Pid ,customerid. Customerid is foreign key of customer table. we have another table orderitem which has two column PId,OrderId. Orderid is foreign key of order table.

I have inserted two records in customer table PId name 1 Ram 2 shyam

in order table

PId customerId 3 1 4 2

In orderitem table

PId Order 5 3 6 4

in sync framework I want to upload only Ram data which has id=1 and its foreign key related tables data.
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
.I am facing some validation problem like this method  ParseUrl is only valid for http url but we are using net.tcp .

ISURL_COMPONENTS ISUrlComponents;


  if ( (ParseUrl(svTempString, &ISUrlComponents) < 0) ) then
            return GetMessageText("Msg_ProLawServiceURLInvalid_Text");  
      else
            if ( !IsObject(ISUrlComponents) ) then
                  return GetMessageText("Msg_ProLawServiceURLInvalid_Text");  
            endif;
      endif;
      endif;
0
Hello and thanks in advance for any help you can give me.

I have written a simple SSIS package in Visual Studio 8 that reads from MSSQL and outputs to Excel 2003.  The package has two dataflows each writing to a different worksheet in the same workbook.  The first dataflow works fine but the second fails with the following error:

[OLE DB Destination [344]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
[OLE DB Destination [344]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "input "OLE DB Destination Input" (357)" failed because error code 0xC020907B occurred, and the error row disposition on "input "OLE DB Destination Input" (357)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "OLE DB Destination" (344) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (357). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.

During development both flows worked, but now I cannot get the second to work at all.  It …
0
Free Tool: Port Scanner
LVL 12
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi

I am trying to integrate .net application with goldmine. I can create contact1 but not contact2 and contsupp. Can you please help me.
I am having problem with the first function (updateContSupp)
goldminestruggle.txt
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
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
I want to show the results on a details page that matches what shows in the dropdown list that I have on the create page. I was able to create different text for values in the dropdown. I am struggling with showing the text on the details page that is redirected after creating the customer. The details page shows the values 0, 1, 2, or 3.

For example, the Create view has a dropdown for Prospect Status with different values. I defined those in SelectListItem in the CustomersController. The value for Prospect Status in the database is actually a 0, 1, 2, or 3.

Customers/Create in CustomersController

        // GET: Customers/Create
        public ActionResult Create(CustomerModel model)
        {
            if (model.Confidence == null)
            {
                model.Confidence = new SelectList(new List<SelectListItem>(){

                    new SelectListItem(){Text="", Value="0"},
                    new SelectListItem(){Text="1 - Very Stable", Value="1"},
                    new SelectListItem(){Text="2 - Stable", Value="2"},
                    new SelectListItem(){Text="3 - At Risk", Value="3"},
                }, "Value", "Text");
            }
            if (model.ProspectStatus == null)
            {
                model.ProspectStatus = new SelectList(new List<SelectListItem>(){

                    new SelectListItem(){Text="Prospective Customer", Value="0"},
                    new SelectListItem(){Text="Existing Customer", Value="1"},
      

Open in new window

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
Keep up with what's happening at Experts Exchange!
LVL 12
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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
When can HttpUtility.HtmlEncode() reduce risk of XSS attack?

I was under the impression that it was best practice to encode the URL before I call Redirect().

For example:
                    return Redirect(HttpUtility.HtmlEncode(returnUrl));

But then was told it makes no difference, since encoding it just means the browser needs to decode it. And, all that matters is how you protect yourself from incoming malicious URL's. Obviously, a hacker can reformat any outputted URL.

Where and when does it make sense to use HttpUtility.HtmlEncode(returnUrl) ?

Thanks
0
How comprehensive is this malicious URL test?

        public static bool IsUrlDomainValid(this Uri uri, List<string> whitelist)
        {
            return whitelist.Any(w => uri.Host.EndsWith(w));
        }

Open in new window


I create a while list that contains various good domains:

www.abc.com
www.xyz.com
www.123.com

and want this function to fail if there is a single domain that is not whitelisted.

Is that was this code does? I get worried with the use of "endswith"

What if the last domain is a good one, but there is a bad one in the middle?

Thanks
0
Hello
Currently we have TMG as web proxy and websense as web filtering
We are going to replace TMG with Bluecoat SG Appliance.

Hence I need to know which design is considered as best in terms of secure and efficiency.

We have 1500 users.

Any help would be appreciated.
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.