C# 信用卡伪装
如何使用下图屏蔽C# 信用卡伪装,c#,regex,winforms,devexpress,C#,Regex,Winforms,Devexpress,如何使用下图屏蔽textedit 如何简化IIN范围,因为对于万事达卡类型,我需要逐个键入它 `[*5]{1}[*1-5]{1}[*0-9]{2}-[*0-9]{4}-[*0-9]{4}-[*0-9]{4,5}` 但是如果MaestrocardType呢?有没有一种格式没有像上面那样一个接一个地明确解释,而且你知道有很多 我是否需要为每种类型的信用卡制作大量的if,以便在文本编辑中进行屏蔽。因此,在combobox中,如果我选择一张特定的信用卡,它将使用该信用卡的屏蔽类型 他是这样做的:
textedit
如何简化IIN范围
,因为对于万事达卡类型,我需要逐个键入它
`[*5]{1}[*1-5]{1}[*0-9]{2}-[*0-9]{4}-[*0-9]{4}-[*0-9]{4,5}`
Maestro
cardType呢?有没有一种格式没有像上面那样一个接一个地明确解释,而且你知道有很多if
,以便在文本编辑中进行屏蔽。因此,在combobox中,如果我选择一张特定的信用卡,它将使用该信用卡的屏蔽类型
字典卡=新字典();
卡。添加(“VISA”,新卡(4,“[5-6]”);
卡片。添加(“MAESTRO”,新卡片(5、[5-6]);
卡片。添加(“FORB”,新卡片(4,[5-6]”);
班级卡
{
公共卡(整数长度,字符串格式){
//待办事项
}
公共整数长度;
公共字符串格式;
}
字典卡=新字典();
卡。添加(“VISA”,新卡(4,“[5-6]”);
卡片。添加(“MAESTRO”,新卡片(5、[5-6]);
卡片。添加(“FORB”,新卡片(4,[5-6]”);
班级卡
{
公共卡(整数长度,字符串格式){
//待办事项
}
公共整数长度;
公共字符串格式;
}
type: 'mastercard'
pattern: /^(5[1-5]|2[2-7])/
length: [16]
type: 'visaelectron'
pattern: /^4(026|17500|405|508|844|91[37])/
length: [16]
type: 'forbrugsforeningen'
pattern: /^600/
length: [16]
Dictionary<string, Card> cards = new Dictionary<string, Card>();
cards.Add("VISA",new Card(4, "[5-6]"));
cards.Add("MAESTRO",new Card(5, "[5-6]"));
cards.Add("FORB",new Card(4, "[5-6]"));
class Card
{
public Card(int length, string format){
//TODO
}
public int Length;
public string format;
}