|
Richard Deeming wrote: the AppDomain.FirstChanceException event[^]. NB: This will generate a lot of noise.
Thank you for that!
Would you happen to know if using this event would cause a significant slowdown, even if the code in the event handler is trivial?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Unfortunately, I don't. I've never actually used that event. But I think Visual Studio uses something similar - the output window usually shows first-chance exceptions in the log when you're debugging.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I would like to place tags on 20 documents that are located in labeled folder. After the tags are place like the zipcode, age, and other applicable choices that are located within the conditional survey it should filter based off the person choices and and the specification of the documents was able to filter because of the tags placed in the folders where docs are inside. And once the survey is submitted it will display the folder with doc9 documents that's applicable.
|
|
|
|
|
And?
You haven't described any kind of problem you're having.
|
|
|
|
|
Member 14515421 wrote: I would like to place tags You have my permission
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
|
how to get oulook current user context in adaptive cards and actionable messages onclick of comment/like in email?
|
|
|
|
|
Please do not post the same question in multiple forums.
|
|
|
|
|
Please let me know if this is not the correct location in the boards for this post. I did not see a section for cryptography or for Security.
A piece of accounting software we use that is for a vertical industry use to store our users passwords in a RDBMS as plain text. They did use a substitution cipher so the password was encrypted at a very basic level. They also used a location specif substitution. I don;t know if that is the correct term for this type of substitution cipher but its where the letter you replace changes based on the original character and its position within the encrypted text. For example if the password was password then the text stored might be h^e)7ght . Even though the s is listed twice its substituted text is different because the first instance is in the 3rd position and the next is in the fourth position. The substituted character was always the same based on original character value plus its postilion so the lower case s was always stored as a lower case e when it was in the third potion of any users password. I hope that properly conveys the encryption method the software used and if there is a proper term for this kind of substitution cipher please post and let me know.
With the most recent update the software vendor has moved to a more complex encryption method and I'm puzzled by it because the encrypted text consist of fewer characters then its source. For example if the password is password then the encrypted text consists of 64 characters. If the password is paswordpasswordpassword the encrypted text is 64 characters long. I assume that when the password is less then 64 characters then the process is padding the rest. What puzzles me is when we use a password that is greater then 64 characters in length. If i create a password that consist of 70 characters the encrypted text is still only 64 characters in length. I'm new to this so this may be a dumb question but how can you use fewer characters then the source text you are encrypting?
|
|
|
|
|
Simple: they have found that they have a legal responsibility to secure password storage, and realised that a substitution cipher (or any form of encryption) is fundamentally in secure.
So instead, they are using a hashing algorithm, which cannot be reversed and which always generates a result that is the same length, in your case 64 bytes. (which would imply SHA-512).
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Just to add some background: Have a look here: Password Storage: How to do it.[^] - it explains why hashing and salting are used instead of encryption.
And remember: if an app has any European Union users then GDPR applies and that means you need to handle passwords as sensitive data and stored them in a safe and secure manner. Text is neither of those and the fines can be .... um ... outstanding. In December 2018 a German company received a relatively low fine of €20,000 for just that.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Message Closed
-- modified 12-Jun-19 10:59am.
|
|
|
|
|
There's no such thing as "opening" a .DLL file. It's just a bunch of code and data. There's nothing to see in them.
You haven't said anything about what you're really trying to do nor on which file. "Open Visual C" doesn't mean anything.
|
|
|
|
|
It may be there just to get the URL in the forum; not much of a real question.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
|
Member 14468470 wrote: Anybody can tell me what can i do. You could start by explaining what version of VisualC, what you are trying to do, and exactly what error you see. The above URL means nothing.
|
|
|
|
|
|
fsdkjasdkjfhfiuwehioeurhfikfahdm,vncx,mnbvkjhfiuheiurfheirugheiurgh
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
I am using Syncfusion in my project and I am showing this ListView:
<SyncfusionListView:SfListView x:Name="ListViewNewItemLocations" SelectionBackgroundColor="Transparent" IsVisible="False" IsScrollBarVisible="false" AutoFitMode="Height" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" ItemAppearing="ListViewNewItemLocations_ItemAppearing" ItemTapped="ListViewNewItemLocations_ItemTapped">
<SyncfusionListView:SfListView.ItemTemplate>
<DataTemplate>
<Frame BorderColor="Black" CornerRadius="25" HasShadow="False">
<StackLayout>
<Label Margin="0,0,0,0" Text="{Binding country_name}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" TextColor="Black" HorizontalTextAlignment="Start" FontSize="15" LineBreakMode="WordWrap" />
<Label Margin="0,0,0,0" Text="{Binding location_address}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" TextColor="Black" HorizontalTextAlignment="Start" FontSize="15" LineBreakMode="WordWrap" />
<Label Margin="0,0,0,0" Text="{Binding telephone}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" TextColor="Black" HorizontalTextAlignment="Start" FontSize="15" LineBreakMode="WordWrap" />
<pre>
<Grid HorizontalOptions="FillAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Syncfusionbuttons:SfButton x:Name="ButtonNewItemLocationEdit2" IsVisible="False" BackgroundColor="Brown" Text="Edit" Grid.Column="0" CornerRadius="25" />
<Syncfusionbuttons:SfButton x:Name="ButtonNewItemLocationEdit" Clicked="ButtonNewItemLocationEdit_Clicked_1" ClassId="abcd" BackgroundColor="Brown" Text="Edit" Grid.Column="0" CornerRadius="25" Command="{Binding Path=BindingContext.TapCommand, Source={x:Reference ListViewNewItemLocations}}" CommandParameter="{Binding LocationModel.ItemLocationID}" />
<Syncfusionbuttons:SfButton x:Name="ButtonNewItemLocationDelete" IsVisible="{Binding IsDeleteVisible}" BackgroundColor="Red" Text="Delete" Grid.Column="1" CornerRadius="25" />
</Grid>
</StackLayout>
</Frame>
</DataTemplate>
</SyncfusionListView:SfListView.ItemTemplate>
and I have I have a ViewModel like this:
using System;
using System.Collections.Generic;
using System.Text;
using Syncfusion.ListView.XForms;
using Syncfusion.XForms.PopupLayout;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Zeera
{
public class ViewModelItemLocation : INotifyPropertyChanged
{
public Command<object> TapCommand { get; set; }
SfPopupLayout popupLayout;
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string name)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
}
public ViewModelItemLocation()
{
TapCommand = new Command<object>(EditButtonTapped);
}
private void EditButtonTapped(object obj)
{
popupLayout = new SfPopupLayout();
popupLayout.PopupView.HeightRequest = 500;
popupLayout.PopupView.WidthRequest = 300;
popupLayout.PopupView.ContentTemplate = new DataTemplate(() =>
{
var mainStack = new StackLayout();
mainStack.BackgroundColor = Color.AliceBlue;
var image = new Image();
image.SetBinding(Image.SourceProperty, new Binding("ContactImage"));
var grid = new Grid();
var NameLabel = new Label()
{
Text = "Customer Name "
};
NameLabel.HorizontalOptions = LayoutOptions.Start;
var label1 = new Entry()
{
};
label1.SetBinding(Entry.TextProperty, new Binding("ContactName"));
label1.HorizontalOptions = LayoutOptions.Start;
var NumberLabel = new Label()
{
Text = "HERE LOCATIO ID"
};
NumberLabel.HorizontalOptions = LayoutOptions.Start;
var label2 = new Entry()
{
};
label2.SetBinding(Entry.TextProperty, new Binding("ContactNumber"));
label2.HorizontalOptions = LayoutOptions.Start;
grid.Children.Add(NameLabel, 0, 0);
grid.Children.Add(label1, 1, 0);
grid.Children.Add(NumberLabel, 0, 1);
grid.Children.Add(label2, 1, 1);
mainStack.Children.Add(image);
mainStack.Children.Add(grid);
return mainStack;
});
popupLayout.PopupView.ShowHeader = false;
popupLayout.PopupView.ShowFooter = false;
popupLayout.HeightRequest = 500;
popupLayout.WidthRequest = 500;
popupLayout.Show();
}
}
}
I have a questions here: How can I pass item_location_id (binded to the SfListView) to the ViewModelItemLocation and then show it in the NumberLabel (created in the ViewModelItemLocation code behind)
Thanks,
Jassim
www.softnames.com
|
|
|
|
|
And you want us to find the relevant field(s) for you?
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hi friends,
I am writing a Unit Test for the method, which has two methods of the same Service are being called, Test method is for the exception case, in one method the Service should return null, it is doing properly, but in the next method it should throw ApplicationException, but it is not throwing, there is no other way to make exception thrown as I need pass the request object and it won't fail there and then calling the Service.
Below is the code for Unit Test, any help would be very very helpful
[TestMethod]
[ExpectedException(typeof(ApplicationException))]
public async Task RegisterOnlineAccountAsync_ExceptionTest()
{
var mockRequest = new OnlineRegistration
{
AccountNumber = "5494526855",
Last4DigitsOfSSN = "4321",
EmailAddress = "abcd@ding.com"
};
var mockPgeAuthResponse = new PgeAuthenticatedUser
{
PersonId = "9013050000",
Email = "abcd@ding.com"
};
PgeAuthenticatedUser mockPgeAuthResponseNull = null;
var mockCCBResponse = new LocatePersonResponse
{
PersonIdList = new List<string> {"9013050000"},
AccountInfoTypes = new List<AccountInfoType>
{
new AccountInfoType
{
AccountNumber = "5494526855",
AccountType = "RES",
MainPersonId = "9013050000"
},
new AccountInfoType
{
AccountNumber = "5494526856",
AccountType = "RES",
MainPersonId = "9013050000"
}
}
};
var mockPaperlessBillResponse = new PaperlessBillResponse
{
EmailAddress = "abcd@ding.com",
IsPaperless = false,
ReceivesCopyOfBill = false
};
var mockPersonDetailResponse = new PersonDetailResponse
{
PersonId = "9013050000",
PersonalIdentifications = new List<PersonalIdentification>
{
new PersonalIdentification
{
Type = "SSN",
Value = "4321"
}
}
};
this._locatePersonContactProxy =
Mock.Of<ILocatePersonContactProxy>(e => e.LocatePersonDetailsAsync(It.IsAny<LocatePersonRequest>()) == Task.FromResult(mockCCBResponse));
this._personDetailsProxy = Mock.Of<IPersonDetailsProxy>(e => e.PersonDetailsGetAsync(It.IsAny<string>()) == Task.FromResult(mockPersonDetailResponse));
this._personManager = Mock.Of<IPersonManager>(e => e.UpdateCcbCssWebUserDetailsAsync(It.IsAny<List<string>>(), It.IsAny<string>()
, It.IsAny<string>(), It.IsAny<string>()) == Task.FromResult(mockPgeAuthResponse));
this._paperlessBillProxy = Mock.Of<IPaperlessBillProxy>(e => e.PaperlessBillingGetAsync(It.IsAny<string>(), It.IsAny<string>()) == Task.FromResult(mockPaperlessBillResponse));
this._paperlessManager = Mock.Of<IPaperlessManager>(e =>
e.PaperlessBillingPreferencesUpdateAsync(It.IsAny<PaperlessBilling>(), It.IsAny<string>(), It.IsAny<string>()) == Task.FromResult(false));
this._customerContactProxy = Mock.Of<ICustomerContactProxy>(e => e.CreateLogAsync(It.IsAny<CustomerContactRequest>()) == Task.FromResult(""));
this._pgeAuthAdminProxy = Mock.Of<IPgeAuthAdminProxy>();
var pgeAuth = new Mock<IPgeAuthAdminProxy>();
pgeAuth.Setup(p => p.GetUserByNameAsync(It.IsAny<string>())).ReturnsAsync(mockPgeAuthResponseNull);
var pgeAuth1 = new Mock<IPgeAuthAdminProxy>();
pgeAuth1.Setup(p => p.CreateUserAccountAsync(It.IsAny<CreateUserAccountRequest>())).Throws(new Exception());
this._pgeMessagingProxy = Mock.Of<IPgeMessagingProxy>(e => e.SendPgeMessageAsync(It.IsAny<PgeMessageRequest>()) == Task.FromResult(false));
this._registrationManager = GetManager();
await this._registrationManager.RegisterOnlineAccountAsync(mockRequest).ConfigureAwait(false);
Assert.ThrowsException<Exception>
(() => new ApplicationException(
$"EmailAddress: ({mockRequest.EmailAddress}) - PersonId: ({mockRequest.PersonId}) - AccountNumber: ({mockRequest.AccountNumber}): Exception caught in AccountManager.Registration.CreateUserOnlineAccountAsync."));
}
The following is the method that needs to be tested:
public async Task<RegisterOnlineAccountResult> RegisterOnlineAccountAsync(OnlineRegistration registration)
{
var registerOnlineAccountResult = new RegisterOnlineAccountResult();
if (registration.PersonId.IsNullOrEmpty())
{
var personDetailsResponse = await this._personDetailsProxy.PersonDetailsGetAsync(registration.PersonId).ConfigureAwait(false);
var cssWebUser = personDetailsResponse?.PersonContactDetails?.FirstOrDefault(pc => pc.ContactType == CSSWebUser);
var xxxAuthenticatedUser = await this._xxxAuthAdminProxy.GetUserByNameAsync(registration.EmailAddress).ConfigureAwait(false);
if (cssWebUser != null)
{
await EnrollUserAsync(response, registration).ConfigureAwait(false);
return new RegisterOnlineAccountResult { OnlineRegistrationAccountResultStatus = OnlineRegistrationAccountResultStatus.Success };
}
if (xxxAuthenticatedUser != null) return new RegisterOnlineAccountResult { OnlineRegistrationAccountResultStatus = OnlineRegistrationAccountResultStatus.WebRegisteredEmailFound };
await EnrollUserAsync(response, registration).ConfigureAwait(false);
registerOnlineAccountResult.OnlineRegistrationAccountResultStatus = OnlineRegistrationAccountResultStatus.Success;
}
else
{
await EnrollStartServiceUser(registration).ConfigureAwait(false);
registerOnlineAccountResult.OnlineRegistrationAccountResultStatus = OnlineRegistrationAccountResultStatus.Success;
}
return registerOnlineAccountResult;
}
private async Task EnrollUserAsync(LocatePersonResponse response, OnlineRegistration onlineRegistration)
{
await CreateUserOnlineAccountAsync(onlineRegistration).ConfigureAwait(false);
}
private async Task<bool> CreateUserOnlineAccountAsync(OnlineRegistration registration)
{
try
{
var request = new CreateUserAccountRequest
{
Description = $"Account created: {DateTime.Now:MM/dd/yyyy}",
AccountType = registration.IsResidential ? nameof(OnlineAccountType.xxxResidentialAcct) : nameof(OnlineAccountType.xxxCommercialAcct),
PersonId = registration.PersonId,
Password = registration.Password,
UserName = registration.EmailAddress,
CcbAccountId = registration.AccountNumber,
BusinessPersonId = !registration.IsResidential ? registration.MainPersonId : null
};
return await this._xxxAuthAdminProxy.CreateUserAccountAsync(request).ConfigureAwait(false);
}
catch (Exception ex)
{
throw new ApplicationException(
$"EmailAddress: ({registration.EmailAddress}) - PersonId: ({registration.PersonId}) - AccountNumber: ({registration.AccountNumber}): Exception caught in AccountManager.Registration.CreateUserOnlineAccountAsync.",
ex);
}
}
If you have seen it here, the _xxxAuthAdminProxy is being called with two different methods 1. GetUserByNameAsync and 2. CreateUserAccountAsync, when condition that needs to happen is GetUserByNameAsync method should return a null where as CreateUserAccountAsync method should throw an exception. any help would be greatly helpful - thanks in advance.
|
|
|
|
|
I think you need to pick an exception that's a little lower in the food chain; you're targetting what would be intended for an app level handler.
Quote: You should derive custom exceptions from the Exception class rather than the ApplicationException class. You should not throw an ApplicationException exception in your code, and you should not catch an ApplicationException exception unless you intend to re-throw the original exception.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I am able to generate mock for one Condition, but not for another condition like, the method GetUserByNameAsync is returning null for the Proxy that I set up as
this._xxxAuthAdminProxy = Mock.Of<IxxxAuthAdminProxy>();
var xxxAuth = new Mock<IxxxAuthAdminProxy>();
xxxAuth.Setup(p => p.GetUserByNameAsync(It.IsAny<string>()))
.ReturnsAsync(mockxxxAuthResponseNull);
xxxAuth.Setup(p => p.CreateUserAccountAsync(It.IsAny<CreateUserAccountRequest>()))
.ThrowsAsync(new Exception());
But CreateUserAccountAsync is not returning exception, any help my friend, anything would be greatly helpful. Thank you.
|
|
|
|
|
I think I told you not to use "ApplicationException" for exceptions "you generate / throw" in you app ... use something else; e.g. throw new Exception("My test blew up as expected");
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|